Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

Commit f5aafba

Browse files
author
Sean Perkins
committed
Fixes publisher/subscriber issues
1 parent 22f5c82 commit f5aafba

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ initSubscriber() {
7070
}
7171
```
7272

73-
7473
### Special Articles
7574
- [Overlay UI on the Video Stream](https://github.com/sean-perkins/nativescript-opentok/wiki/Overlay-UI-on-Video-Stream)
7675
- [Angular 2 Integration Guide](https://github.com/sean-perkins/nativescript-opentok/wiki/Angular-2-Integration-Guide)
7776
- [Controlling Resolution and FPS](https://github.com/sean-perkins/nativescript-opentok/wiki/Controlling-Frame-Rate-and-Resolution)
7877
- [Event Hooks](https://github.com/sean-perkins/nativescript-opentok/wiki/Event-Hooks)
78+
- [iOS 10 Notice](https://github.com/sean-perkins/nativescript-opentok/wiki/iOS-10-Notice)
7979

8080
### Images
8181
|iPhone|iPad|

demo/app/App_Resources/iOS/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,7 @@
4545
<string>We need your camera to display your feed.</string>
4646
<key>NSMicrophoneUsageDescription</key>
4747
<string>We need your microphone to hear your voice.</string>
48+
<key>UIBackgroundModes</key>
49+
<string>audio</strong>
4850
</dict>
4951
</plist>

demo/app/main-view-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ export class Demo extends Observable {
2222
this.publisher = <TNSOTPublisher> this.page.getViewById('publisher');
2323
this.subscriber = <TNSOTSubscriber> this.page.getViewById('subscriber');
2424
this.session.subscriber = this.subscriber;
25-
this.session.connect(this._publisherToken);
2625
}
2726

2827
publish() {
28+
this.session.connect(this._publisherToken);
2929
this.publisher.publish(this.session, '', 'HIGH', '30');
3030
}
3131

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-opentok",
3-
"version": "1.6.3",
3+
"version": "1.6.4",
44
"description": "Integrates OpenTok for NativeScript.",
55
"main": "opentok.js",
66
"typings": "./opentok.d.ts",

src/ios/publisher.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export class TNSOTPublisher extends ContentView {
2020

2121
constructor() {
2222
super();
23-
this._publisherKitDelegate = TNSPublisherKitDelegateImpl.initWithOwner(new WeakRef(this));
2423
this._view = UIView.alloc().init();
24+
this._publisherKitDelegate = TNSPublisherKitDelegateImpl.initWithOwner(new WeakRef(this));
2525
}
2626

2727
publish(session: TNSOTSession, name?:string, cameraResolution?: string, cameraFrameRate?: string): void {
@@ -41,7 +41,7 @@ export class TNSOTPublisher extends ContentView {
4141
let stream: any = result.object;
4242
this.setIdleTimer(true);
4343
try {
44-
stream.publish(this._ios);
44+
stream.session.publish(this._ios);
4545
} catch(error) {
4646
console.log(error);
4747
}
@@ -190,6 +190,7 @@ class TNSPublisherKitDelegateImpl extends NSObject {
190190
})
191191
});
192192
}
193+
console.log(error);
193194
}
194195

195196
get events(): Observable {

src/ios/session.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class TNSOTSession extends NSObject {
6969
return this._events;
7070
}
7171

72-
public sessionDidConnect(session: any) {
72+
sessionDidConnect(session: any) {
7373
if (this.events) {
7474
this.events.notify({
7575
eventName: 'sessionDidConnect',
@@ -80,7 +80,7 @@ export class TNSOTSession extends NSObject {
8080
}
8181
}
8282

83-
public sessionDidDisconnect(session: any) {
83+
sessionDidDisconnect(session: any) {
8484
if (this.events) {
8585
this.events.notify({
8686
eventName: 'sessionDidDisconnect',
@@ -91,7 +91,7 @@ export class TNSOTSession extends NSObject {
9191
}
9292
}
9393

94-
public sessionDidReconnect(session: any) {
94+
sessionDidReconnect(session: any) {
9595
if (this.events) {
9696
this.events.notify({
9797
eventName: 'sessionDidReconnect',
@@ -102,7 +102,7 @@ export class TNSOTSession extends NSObject {
102102
}
103103
}
104104

105-
public sessionDidBeginReconnecting(session: any) {
105+
sessionDidBeginReconnecting(session: any) {
106106
if (this.events) {
107107
this.events.notify({
108108
eventName: 'sessionDidBeginReconnecting',
@@ -113,7 +113,7 @@ export class TNSOTSession extends NSObject {
113113
}
114114
}
115115

116-
public sessionStreamCreated(session: any, stream: any) {
116+
sessionStreamCreated(session: any, stream: any) {
117117
if (this.events) {
118118
this.events.notify({
119119
eventName: 'streamCreated',
@@ -128,7 +128,7 @@ export class TNSOTSession extends NSObject {
128128
}
129129
}
130130

131-
public sessionStreamDestroyed(session: any, stream: any) {
131+
sessionStreamDestroyed(session: any, stream: any) {
132132
if (this.events) {
133133
this.events.notify({
134134
eventName: 'streamDestroyed',
@@ -140,7 +140,7 @@ export class TNSOTSession extends NSObject {
140140
}
141141
}
142142

143-
public sessionDidFailWithError(session: any, error: any) {
143+
sessionDidFailWithError(session: any, error: any) {
144144
if (this.events) {
145145
this.events.notify({
146146
eventName: 'didFailWithError',
@@ -152,7 +152,7 @@ export class TNSOTSession extends NSObject {
152152
}
153153
}
154154

155-
public sessionConnectionDestroyed(session: any, connection: any) {
155+
sessionConnectionDestroyed(session: any, connection: any) {
156156
if (this.events) {
157157
this.events.notify({
158158
eventName: 'connectionDestroyed',
@@ -164,7 +164,7 @@ export class TNSOTSession extends NSObject {
164164
}
165165
}
166166

167-
public sessionConnectionCreated(session: any, connection: any) {
167+
sessionConnectionCreated(session: any, connection: any) {
168168
if (this.events) {
169169
this.events.notify({
170170
eventName: 'connectionCreated',
@@ -176,7 +176,7 @@ export class TNSOTSession extends NSObject {
176176
}
177177
}
178178

179-
public sessionArchiveStartedWithId(session: any, archiveId: string, name?: string) {
179+
sessionArchiveStartedWithId(session: any, archiveId: string, name?: string) {
180180
if (this.events) {
181181
this.events.notify({
182182
eventName: 'archiveStartedWithId',
@@ -189,7 +189,7 @@ export class TNSOTSession extends NSObject {
189189
}
190190
}
191191

192-
public sessionArchiveStoppedWithId(session: any, archiveId: string) {
192+
sessionArchiveStoppedWithId(session: any, archiveId: string) {
193193
if (this.events) {
194194
this.events.notify({
195195
eventName: 'archiveStoppedWithId',

0 commit comments

Comments
 (0)