@@ -302,7 +302,7 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
302
302
this . _setInfo ( ) ;
303
303
this . _setPoster ( ) ;
304
304
this . Update ( ) ;
305
- if ( _that . on . PlayerInit && typeof ( _that . on . PlayerInit ) === 'function' ) _that . on . PlayerInit ( _that , _that . Player ) ;
305
+ if ( this . on . PlayerInit && typeof ( this . on . PlayerInit ) === 'function' ) this . on . PlayerInit ( _that , _that . Player ) ;
306
306
} ) ;
307
307
this . Player . on ( 'loadeddata' , ( ) => {
308
308
if ( _loadeddata_flg ) return false ;
@@ -311,7 +311,7 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
311
311
this . _setInfo ( ) ;
312
312
this . _setPoster ( ) ;
313
313
this . Update ( ) ;
314
- if ( _that . on . PlayerInit && typeof ( _that . on . PlayerInit ) === 'function' ) _that . on . PlayerInit ( _that , _that . Player ) ;
314
+ if ( this . on . PlayerInit && typeof ( this . on . PlayerInit ) === 'function' ) this . on . PlayerInit ( _that , _that . Player ) ;
315
315
} ) ;
316
316
317
317
// For Timeupdate.
@@ -321,13 +321,13 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
321
321
322
322
// For Volume change.
323
323
this . Player . on ( 'volumechange' , ( ) => {
324
- // 音量バーの更新(% )
324
+ // update(% )
325
325
let _volume = this . Player . volume ( ) ;
326
326
327
327
DOM . setStyle ( this . $ . uiSeekbarVolCover , { width : ( _volume * 100 ) + '%' } ) ;
328
328
329
- if ( _that . on . VolumeChange && typeof ( _that . on . VolumeChange ) === 'function' ) {
330
- _that . on . VolumeChange ( {
329
+ if ( this . on . VolumeChange && typeof ( this . on . VolumeChange ) === 'function' ) {
330
+ this . on . VolumeChange ( {
331
331
volume : PLAYER_MODULE_BRIGHTCOVE . toFixedNumber ( _volume , 3 ) ,
332
332
par : PLAYER_MODULE_BRIGHTCOVE . toFixedNumber ( _volume * 100 , 1 )
333
333
} ) ;
@@ -337,17 +337,17 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
337
337
// For Ended movie paly.
338
338
this . Player . on ( 'ended' , ( ) => {
339
339
this . Stop ( ) ;
340
- if ( _that . on . PlayerEnded && typeof ( _that . on . PlayerEnded ) === 'function' ) _that . on . PlayerEnded ( _that , _that . Player ) ;
340
+ if ( this . on . PlayerEnded && typeof ( this . on . PlayerEnded ) === 'function' ) this . on . PlayerEnded ( _that , _that . Player ) ;
341
341
} ) ;
342
342
343
343
this . Player . on ( 'play' , ( ) => {
344
344
this . ClassOn ( ) ;
345
- if ( _that . on . PlayerPlay && typeof ( _that . on . PlayerPlay ) === 'function' ) _that . on . PlayerPlay ( _that , _that . Player ) ;
345
+ if ( this . on . PlayerPlay && typeof ( this . on . PlayerPlay ) === 'function' ) this . on . PlayerPlay ( _that , _that . Player ) ;
346
346
} ) ;
347
347
348
348
this . Player . on ( 'pause' , ( ) => {
349
349
this . ClassOff ( ) ;
350
- if ( _that . on . PlayerPause && typeof ( _that . on . PlayerPause ) === 'function' ) _that . on . PlayerPause ( _that , _that . Player ) ;
350
+ if ( this . on . PlayerPause && typeof ( this . on . PlayerPause ) === 'function' ) this . on . PlayerPause ( _that , _that . Player ) ;
351
351
} ) ;
352
352
353
353
// For Error
@@ -712,9 +712,10 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
712
712
* When Media change.
713
713
*
714
714
* id | str | media-id.
715
- * callback | function | callback function after changed.
715
+ * isplay | boolean | auto start after changed media.
716
+ * callback | function | callback function after changed media.
716
717
*/
717
- Change ( id : any , callback ?: ( ) => { } ) {
718
+ Change ( id : any , isplay : boolean = true , callback ?: ( ) => { } ) {
718
719
719
720
// 動画IDが取得出来ない場合は処理を中止
720
721
if ( id == '' || id == null || id == undefined ) return ;
@@ -735,8 +736,10 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
735
736
}
736
737
737
738
// Run playback start processing once in the click event propagation.
738
- // this.Player.muted(true);
739
- this . Player . play ( ) ;
739
+ if ( isplay ) {
740
+ this . Player . play ( ) ;
741
+ this . Player . muted ( true ) ;
742
+ }
740
743
741
744
this . Player . catalog . getVideo ( id , ( error : any , video : any ) => {
742
745
@@ -748,12 +751,14 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
748
751
this . _setPoster ( ) ;
749
752
750
753
// replay after data change.
751
- setTimeout ( ( ) => {
752
- this . Player . play ( ) ;
753
- // this.Player.muted(false);
754
- this . ClassOff ( ) ;
755
- this . ClassOn ( ) ;
756
- } , 100 ) ;
754
+ if ( isplay ) {
755
+ setTimeout ( ( ) => {
756
+ this . Player . muted ( false ) ;
757
+ this . Player . play ( ) ;
758
+ this . ClassOff ( ) ;
759
+ this . ClassOn ( ) ;
760
+ } , 100 ) ;
761
+ }
757
762
758
763
setTimeout ( ( ) => {
759
764
this . PlayerChangeLoadFlg = true ;
@@ -772,7 +777,9 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
772
777
773
778
774
779
} else {
775
- this . Play ( ) ;
780
+ if ( isplay ) {
781
+ this . Play ( ) ;
782
+ }
776
783
777
784
if ( ! this . on . Change && callback ) this . on . Change = callback ;
778
785
if ( this . on . Change && typeof ( this . on . Change ) === 'function' ) this . on . Change ( this , this . Player ) ;
0 commit comments