This repository was archived by the owner on Mar 9, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-15
lines changed Expand file tree Collapse file tree 3 files changed +11
-15
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"nativescript" : {
3
3
"id" : " com.mobileagility.opentok" ,
4
- "tns-android" : {
5
- "version" : " 2.4.1"
6
- },
7
4
"tns-ios" : {
8
5
"version" : " 2.4.0"
6
+ },
7
+ "tns-android" : {
8
+ "version" : " 2.4.1"
9
9
}
10
10
},
11
11
"dependencies" : {
23
23
"tns-platform-declarations" : " ^2.4.0" ,
24
24
"typescript" : " ^2.0.7"
25
25
}
26
- }
26
+ }
Original file line number Diff line number Diff line change @@ -230,17 +230,6 @@ export class TNSOTSession {
230
230
this . session . subscribe ( subInstance ) ;
231
231
}
232
232
233
- public unsubscribe ( ) : Promise < any > {
234
- return new Promise ( ( resolve , reject ) => {
235
- try {
236
- this . session . unsubscribe ( this . subscriber ) ;
237
- resolve ( ) ;
238
- } catch ( err ) {
239
- reject ( err ) ;
240
- }
241
- } ) ;
242
- }
243
-
244
233
get sessionEvents ( ) : Observable {
245
234
return this . _sessionEvents ;
246
235
}
Original file line number Diff line number Diff line change 1
1
import { Observable } from "data/observable" ;
2
2
import { ContentView } from 'ui/content-view' ;
3
+ import { TNSOTSession } from "./session" ;
3
4
declare var com : any , android : any ;
4
5
const StreamListener = com . opentok . android . SubscriberKit . StreamListener ;
5
6
const SubscriberListener = com . opentok . android . SubscriberKit . SubscriberListener ;
@@ -111,5 +112,11 @@ export class TNSOTSubscriber extends ContentView {
111
112
this . _subscriber . setSubscribeToAudio ( state ) ;
112
113
}
113
114
115
+ unsubscribe ( session : TNSOTSession ) {
116
+ if ( this . _subscriber ) {
117
+ session . session . unsubscribe ( this . _subscriber ) ;
118
+ }
119
+ }
120
+
114
121
115
122
}
You can’t perform that action at this time.
0 commit comments