This repository was archived by the owner on Mar 9, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " nativescript-opentok" ,
3
- "version" : " 1.6.7 " ,
3
+ "version" : " 1.6.8 " ,
4
4
"description" : " Integrates OpenTok for NativeScript." ,
5
5
"main" : " opentok.js" ,
6
6
"typings" : " ./opentok.d.ts" ,
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ export class TNSOTSubscriber extends ContentView {
10
10
private _android : any ;
11
11
private _subscriber : any ;
12
12
private _events :Observable ;
13
+ _render_style : any ;
14
+
13
15
constructor ( ) {
14
16
super ( ) ;
15
17
this . _events = new Observable ( ) ;
@@ -33,8 +35,7 @@ export class TNSOTSubscriber extends ContentView {
33
35
subscribe ( session : any , stream : any ) {
34
36
const that = new WeakRef ( this ) ;
35
37
this . _subscriber = new com . opentok . android . Subscriber ( utils . ad . getApplicationContext ( ) , stream ) ;
36
- this . _subscriber . getRenderer ( ) . setStyle ( com . opentok . android . BaseVideoRenderer . STYLE_VIDEO_SCALE ,
37
- com . opentok . android . BaseVideoRenderer . STYLE_VIDEO_FILL ) ;
38
+ this . _subscriber . getRenderer ( ) . setStyle ( com . opentok . android . BaseVideoRenderer . STYLE_VIDEO_SCALE , this . render_style ) ;
38
39
this . _subscriber . setSubscriberListener ( new com . opentok . android . SubscriberKit . SubscriberListener ( {
39
40
owner : that . get ( ) ,
40
41
onConnected ( subscriber ) {
@@ -135,4 +136,25 @@ export class TNSOTSubscriber extends ContentView {
135
136
return this . _events ;
136
137
}
137
138
139
+ get render_style ( ) {
140
+ return this . _render_style ;
141
+ }
142
+
143
+ set render_style ( value : any ) {
144
+ switch ( value ) {
145
+ case 'fit' :
146
+ this . _render_style = com . opentok . android . BaseVideoRenderer . STYLE_VIDEO_FIT ;
147
+ break ;
148
+ case 'fill' :
149
+ this . _render_style = com . opentok . android . BaseVideoRenderer . STYLE_VIDEO_FILL ;
150
+ break ;
151
+ case 'scale' :
152
+ this . _render_style = com . opentok . android . BaseVideoRenderer . STYLE_VIDEO_SCALE ;
153
+ break ;
154
+ default :
155
+ this . _render_style = com . opentok . android . BaseVideoRenderer . STYLE_VIDEO_FIT ;
156
+ break ;
157
+ }
158
+ }
159
+
138
160
}
You can’t perform that action at this time.
0 commit comments