@@ -23,7 +23,7 @@ export default class Video extends Component {
23
23
showPoster : ! ! props . poster ,
24
24
androidFullScreen : false ,
25
25
videoContainerLayout_x : 0 ,
26
- videoContainerLayout_y : 0
26
+ videoContainerLayout_y : 0 ,
27
27
} ;
28
28
this . getDimension ( ) ;
29
29
}
@@ -46,9 +46,9 @@ export default class Video extends Component {
46
46
UIManager . measure ( findNodeHandle ( this . _videoContainer ) , ( x , y ) => {
47
47
this . setState ( {
48
48
videoContainerLayout_x : x ,
49
- videoContainerLayout_y : y
50
- } )
51
- } )
49
+ videoContainerLayout_y : y ,
50
+ } ) ;
51
+ } ) ;
52
52
}
53
53
54
54
setNativeProps ( nativeProps ) {
@@ -57,12 +57,12 @@ export default class Video extends Component {
57
57
58
58
toTypeString ( x ) {
59
59
switch ( typeof x ) {
60
- case " object" :
60
+ case ' object' :
61
61
return x instanceof Date
62
62
? x . toISOString ( )
63
63
: JSON . stringify ( x ) ; // object, null
64
- case " undefined" :
65
- return "" ;
64
+ case ' undefined' :
65
+ return '' ;
66
66
default : // boolean, number, string
67
67
return x . toString ( ) ;
68
68
}
@@ -79,14 +79,14 @@ export default class Video extends Component {
79
79
}
80
80
81
81
seek = ( time , tolerance = 100 ) => {
82
- if ( isNaN ( time ) ) throw new Error ( 'Specified time is not a number' ) ;
82
+ if ( isNaN ( time ) ) { throw new Error ( 'Specified time is not a number' ) ; }
83
83
84
84
if ( Platform . OS === 'ios' ) {
85
85
this . setNativeProps ( {
86
86
seek : {
87
87
time,
88
- tolerance
89
- }
88
+ tolerance,
89
+ } ,
90
90
} ) ;
91
91
} else {
92
92
this . setNativeProps ( { seek : time } ) ;
@@ -172,7 +172,7 @@ export default class Video extends Component {
172
172
} ;
173
173
174
174
_onFullscreenPlayerWillPresent = ( event ) => {
175
- Platform . OS === 'android' && this . setState ( { androidFullScreen : true } )
175
+ Platform . OS === 'android' && this . setState ( { androidFullScreen : true } ) ;
176
176
if ( this . props . onFullscreenPlayerWillPresent ) {
177
177
this . props . onFullscreenPlayerWillPresent ( event . nativeEvent ) ;
178
178
}
@@ -185,7 +185,7 @@ export default class Video extends Component {
185
185
} ;
186
186
187
187
_onFullscreenPlayerWillDismiss = ( event ) => {
188
- Platform . OS === 'android' && this . setState ( { androidFullScreen : false } )
188
+ Platform . OS === 'android' && this . setState ( { androidFullScreen : false } ) ;
189
189
if ( this . props . onFullscreenPlayerWillDismiss ) {
190
190
this . props . onFullscreenPlayerWillDismiss ( event . nativeEvent ) ;
191
191
}
@@ -201,7 +201,7 @@ export default class Video extends Component {
201
201
if ( ! this . props . audioOnly ) {
202
202
this . _hidePoster ( ) ;
203
203
}
204
-
204
+
205
205
if ( this . props . onReadyForDisplay ) {
206
206
this . props . onReadyForDisplay ( event . nativeEvent ) ;
207
207
}
@@ -271,7 +271,7 @@ export default class Video extends Component {
271
271
render ( ) {
272
272
const resizeMode = this . props . resizeMode ;
273
273
const source = resolveAssetSource ( this . props . source ) || { } ;
274
- const shouldCache = ! Boolean ( source . __packager_asset )
274
+ const shouldCache = ! source . __packager_asset ;
275
275
276
276
let uri = source . uri || '' ;
277
277
if ( uri && uri . match ( / ^ \/ / ) ) {
@@ -310,7 +310,7 @@ export default class Video extends Component {
310
310
type : source . type || '' ,
311
311
mainVer : source . mainVer || 0 ,
312
312
patchVer : source . patchVer || 0 ,
313
- requestHeaders : source . headers ? this . stringsOnlyObject ( source . headers ) : { }
313
+ requestHeaders : source . headers ? this . stringsOnlyObject ( source . headers ) : { } ,
314
314
} ,
315
315
onVideoLoadStart : this . _onLoadStart ,
316
316
onVideoLoad : this . _onLoad ,
@@ -350,14 +350,17 @@ export default class Video extends Component {
350
350
width : this . width ,
351
351
height : this . height ,
352
352
backgroundColor : '#ffffff' ,
353
- justifyContent : " center" ,
353
+ justifyContent : ' center' ,
354
354
zIndex : 99999 ,
355
355
marginTop : - 1 * ( this . state . videoContainerLayout_y ? parseFloat ( this . state . videoContainerLayout_y ) : 0 ) , //margin: 0 - is not working properly. So, updated all the margin individually with 0.
356
- marginLeft : - 1 * ( this . state . videoContainerLayout_x ? parseFloat ( this . state . videoContainerLayout_x ) : 0 )
357
- } : { }
356
+ marginLeft : - 1 * ( this . state . videoContainerLayout_x ? parseFloat ( this . state . videoContainerLayout_x ) : 0 ) ,
357
+ } : { } ;
358
358
359
359
return (
360
- < View ref = { ( videoContainer ) => this . _videoContainer = videoContainer } style = { [ nativeProps . style , videoStyle ] } >
360
+ < View ref = { ( videoContainer ) => {
361
+ this . _videoContainer = videoContainer ;
362
+ return videoContainer ;
363
+ } } style = { [ nativeProps . style , videoStyle ] } >
361
364
< RCTVideo
362
365
ref = { this . _assignRoot }
363
366
{ ...nativeProps }
@@ -388,14 +391,14 @@ Video.propTypes = {
388
391
FilterType . PROCESS ,
389
392
FilterType . TONAL ,
390
393
FilterType . TRANSFER ,
391
- FilterType . SEPIA
394
+ FilterType . SEPIA ,
392
395
] ) ,
393
396
filterEnabled : PropTypes . bool ,
394
397
/* Native only */
395
398
src : PropTypes . object ,
396
399
seek : PropTypes . oneOfType ( [
397
400
PropTypes . number ,
398
- PropTypes . object
401
+ PropTypes . object ,
399
402
] ) ,
400
403
fullscreen : PropTypes . bool ,
401
404
onVideoLoadStart : PropTypes . func ,
@@ -417,10 +420,10 @@ Video.propTypes = {
417
420
/* Wrapper component */
418
421
source : PropTypes . oneOfType ( [
419
422
PropTypes . shape ( {
420
- uri : PropTypes . string
423
+ uri : PropTypes . string ,
421
424
} ) ,
422
425
// Opaque type returned by require('./video.mp4')
423
- PropTypes . number
426
+ PropTypes . number ,
424
427
] ) ,
425
428
minLoadRetryCount : PropTypes . number ,
426
429
maxBitRate : PropTypes . number ,
@@ -434,22 +437,22 @@ Video.propTypes = {
434
437
type : PropTypes . string . isRequired ,
435
438
value : PropTypes . oneOfType ( [
436
439
PropTypes . string ,
437
- PropTypes . number
438
- ] )
440
+ PropTypes . number ,
441
+ ] ) ,
439
442
} ) ,
440
443
selectedVideoTrack : PropTypes . shape ( {
441
444
type : PropTypes . string . isRequired ,
442
445
value : PropTypes . oneOfType ( [
443
446
PropTypes . string ,
444
- PropTypes . number
445
- ] )
447
+ PropTypes . number ,
448
+ ] ) ,
446
449
} ) ,
447
450
selectedTextTrack : PropTypes . shape ( {
448
451
type : PropTypes . string . isRequired ,
449
452
value : PropTypes . oneOfType ( [
450
453
PropTypes . string ,
451
- PropTypes . number
452
- ] )
454
+ PropTypes . number ,
455
+ ] ) ,
453
456
} ) ,
454
457
textTracks : PropTypes . arrayOf (
455
458
PropTypes . shape ( {
@@ -460,7 +463,7 @@ Video.propTypes = {
460
463
TextTrackType . TTML ,
461
464
TextTrackType . VTT ,
462
465
] ) ,
463
- language : PropTypes . string . isRequired
466
+ language : PropTypes . string . isRequired ,
464
467
} )
465
468
) ,
466
469
paused : PropTypes . bool ,
0 commit comments