@@ -115,8 +115,6 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
115
115
uiSeekbarTimeBg : [ ] ,
116
116
uiSeekbarTimeCover : [ ] ,
117
117
uiBtnChange : [ ] ,
118
- uiBtnChangeDisplayTime : [ ] ,
119
- uiBtnChangeDisplayTimeDown : [ ] ,
120
118
uiBtnDataId : [ ] ,
121
119
} ;
122
120
@@ -134,7 +132,7 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
134
132
poster : ''
135
133
}
136
134
137
- constructor ( options : any = { } ) {
135
+ constructor ( options : any ) {
138
136
139
137
if ( ! options . id || ! options . videoid ) {
140
138
console . log ( 'Inadequate parameters (id, videoid)' ) ;
@@ -222,7 +220,7 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
222
220
223
221
}
224
222
225
- BuildPlayer ( ) {
223
+ private BuildPlayer ( ) {
226
224
let _that = this ;
227
225
228
226
// Player Ui.
@@ -270,7 +268,7 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
270
268
s . onerror = function ( ) {
271
269
console . log ( 'ERROR: not script loaded.' ) ;
272
270
} ;
273
- s . src = this . playerScriptCode + '?' + Date . now ( ) ;
271
+ s . src = ` ${ this . playerScriptCode } ? ${ Date . now ( ) } ` ;
274
272
275
273
document . body . appendChild ( s ) ;
276
274
}
@@ -387,32 +385,30 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
387
385
this . $ . playerElemMain = DOM . selectDom ( `#${ this . CONFIG . id } #${ this . CONFIG . player_id } ` ) ;
388
386
this . $ . playerElemMainWrap = DOM . selectDom ( `#${ this . CONFIG . id } #${ this . CONFIG . player_id_wrap } ` ) ;
389
387
390
- this . $ . uiBtnPlay = DOM . selectDom ( '#' + this . CONFIG . id + ' .btn_play' ) ;
391
- this . $ . uiBtnStop = DOM . selectDom ( '#' + this . CONFIG . id + ' .btn_stop' ) ;
392
- this . $ . uiBtnPause = DOM . selectDom ( '#' + this . CONFIG . id + ' .btn_pause' ) ;
393
- this . $ . uiBtnMute = DOM . selectDom ( '#' + this . CONFIG . id + ' .btn_mute' ) ;
394
- this . $ . uiBtnVolon = DOM . selectDom ( '#' + this . CONFIG . id + ' .btn_volon' ) ;
395
- this . $ . uiBtnVoloff = DOM . selectDom ( '#' + this . CONFIG . id + ' .btn_voloff' ) ;
396
-
397
- this . $ . uiDisplayTime = DOM . selectDom ( '#' + this . CONFIG . id + ' .display_time' ) ;
398
- this . $ . uiDisplayTimeNow = DOM . selectDom ( '#' + this . CONFIG . id + ' .display_time_now' ) ;
399
- this . $ . uiDisplayTimeTotal = DOM . selectDom ( '#' + this . CONFIG . id + ' .display_time_total' ) ;
400
- this . $ . uiDisplayTimeDown = DOM . selectDom ( '#' + this . CONFIG . id + ' .display_time_down' ) ;
401
- this . $ . uiDisplayTimePar = DOM . selectDom ( '#' + this . CONFIG . id + ' .display_time_par' ) ;
402
- this . $ . uiDisplayPoster = DOM . selectDom ( '#' + this . CONFIG . id + ' .display_poster' ) ;
403
- this . $ . uiDisplayPosterBg = DOM . selectDom ( '#' + this . CONFIG . id + ' .display_poster_background' ) ;
404
- this . $ . uiDisplayName = DOM . selectDom ( '#' + this . CONFIG . id + ' .display_name' ) ;
405
-
406
- this . $ . uiSeekbarVol = DOM . selectDom ( '#' + this . CONFIG . id + ' .seekbar_vol' ) ;
407
- this . $ . uiSeekbarVolBg = DOM . selectDom ( '#' + this . CONFIG . id + ' .seekbar_vol .seekbar_vol_bg' ) ;
408
- this . $ . uiSeekbarVolCover = DOM . selectDom ( '#' + this . CONFIG . id + ' .seekbar_vol span' ) ;
409
- this . $ . uiSeekbarTime = DOM . selectDom ( '#' + this . CONFIG . id + ' .seekbar_time' ) ;
410
- this . $ . uiSeekbarTimeBg = DOM . selectDom ( '#' + this . CONFIG . id + ' .seekbar_time .seekbar_time_bg' ) ;
411
- this . $ . uiSeekbarTimeCover = DOM . selectDom ( '#' + this . CONFIG . id + ' .seekbar_time span' ) ;
412
-
413
- this . $ . uiBtnChange = DOM . selectDom ( '#' + this . CONFIG . id + ' .btn_change' ) ;
414
- this . $ . uiBtnChangeDisplayTime = DOM . selectDom ( '#' + this . CONFIG . id + ' .display_time' ) ;
415
- this . $ . uiBtnChangeDisplayTimeDown = DOM . selectDom ( '#' + this . CONFIG . id + ' .display_time_down' ) ;
388
+ this . $ . uiBtnPlay = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-btn-play' ) ;
389
+ this . $ . uiBtnStop = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-btn-stop' ) ;
390
+ this . $ . uiBtnPause = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-btn-pause' ) ;
391
+ this . $ . uiBtnMute = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-btn-mute' ) ;
392
+ this . $ . uiBtnVolon = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-btn-volon' ) ;
393
+ this . $ . uiBtnVoloff = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-btn-voloff' ) ;
394
+
395
+ this . $ . uiDisplayTime = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-time' ) ;
396
+ this . $ . uiDisplayTimeNow = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-time-now' ) ;
397
+ this . $ . uiDisplayTimeTotal = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-time-total' ) ;
398
+ this . $ . uiDisplayTimeDown = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-time-down' ) ;
399
+ this . $ . uiDisplayTimePar = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-time-par' ) ;
400
+ this . $ . uiDisplayPoster = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-poster' ) ;
401
+ this . $ . uiDisplayPosterBg = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-poster-background' ) ;
402
+ this . $ . uiDisplayName = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-name' ) ;
403
+
404
+ this . $ . uiSeekbarVol = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-seekbar-vol' ) ;
405
+ this . $ . uiSeekbarVolBg = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-seekbar-vol .ui-seekbar-vol-bg' ) ;
406
+ this . $ . uiSeekbarVolCover = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-seekbar-vol span' ) ;
407
+ this . $ . uiSeekbarTime = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-seekbar-time' ) ;
408
+ this . $ . uiSeekbarTimeBg = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-seekbar-time .ui-seekbar-time-bg' ) ;
409
+ this . $ . uiSeekbarTimeCover = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-seekbar-time span' ) ;
410
+
411
+ this . $ . uiBtnChange = DOM . selectDom ( '#' + this . CONFIG . id + ' .ui-btn-change' ) ;
416
412
417
413
this . $ . uiBtnDataId = DOM . selectDom ( '[data-PMB-id]' ) ;
418
414
}
@@ -629,10 +625,8 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
629
625
// update player data. (ms)
630
626
if ( this . $ . uiDisplayTime ) DOM . setHtml ( this . $ . uiDisplayTime , this . GetTime ( ) + '/' + this . GetTimeMax ( ) ) ;
631
627
if ( this . $ . uiDisplayTimeNow ) DOM . setHtml ( this . $ . uiDisplayTimeNow , this . GetTime ( ) ) ;
632
- if ( this . $ . uiDisplayTimeTotal ) DOM . setHtml ( this . $ . uiDisplayTimeTotal , this . GetTimeMax ( ) ) ;
633
628
if ( this . $ . uiDisplayTimeDown ) DOM . setHtml ( this . $ . uiDisplayTimeDown , this . GetTimeDown ( ) ) ;
634
- if ( this . $ . uiBtnChangeDisplayTime ) DOM . setHtml ( this . $ . uiBtnChangeDisplayTime , this . GetTime ( ) + '/' + this . GetTimeMax ( ) ) ;
635
- if ( this . $ . uiBtnChangeDisplayTimeDown ) DOM . setHtml ( this . $ . uiBtnChangeDisplayTimeDown , this . GetTimeDown ( ) ) ;
629
+ if ( this . $ . uiDisplayTimeTotal ) DOM . setHtml ( this . $ . uiDisplayTimeTotal , this . GetTimeMax ( ) ) ;
636
630
637
631
// update play time. (%)
638
632
if ( this . $ . uiDisplayTimePar ) DOM . setHtml ( this . $ . uiDisplayTimePar , this . GetTimePar ( ) ) ;
@@ -651,12 +645,10 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
651
645
}
652
646
} else {
653
647
// update player data. (ms)
654
- if ( this . $ . uiDisplayTime ) DOM . setHtml ( this . $ . uiDisplayTime , '00:00' ) ;
648
+ if ( this . $ . uiDisplayTime ) DOM . setHtml ( this . $ . uiDisplayTime , '00:00/00:00 ' ) ;
655
649
if ( this . $ . uiDisplayTimeNow ) DOM . setHtml ( this . $ . uiDisplayTimeNow , '00:00' ) ;
656
- if ( this . $ . uiDisplayTimeTotal ) DOM . setHtml ( this . $ . uiDisplayTimeTotal , '00:00' ) ;
657
650
if ( this . $ . uiDisplayTimeDown ) DOM . setHtml ( this . $ . uiDisplayTimeDown , '00:00' ) ;
658
- if ( this . $ . uiBtnChangeDisplayTime ) DOM . setHtml ( this . $ . uiBtnChangeDisplayTime , '00:00' ) ;
659
- if ( this . $ . uiBtnChangeDisplayTimeDown ) DOM . setHtml ( this . $ . uiBtnChangeDisplayTimeDown , '00:00' ) ;
651
+ if ( this . $ . uiDisplayTimeTotal ) DOM . setHtml ( this . $ . uiDisplayTimeTotal , '00:00' ) ;
660
652
661
653
// update play time. (%)
662
654
if ( this . $ . uiDisplayTimePar ) DOM . setHtml ( this . $ . uiDisplayTimePar , '0%' ) ;
@@ -824,7 +816,7 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
824
816
}
825
817
826
818
GetTimeDown ( ) {
827
- let _countDownTime = this . Player . duration ( ) - this . Player . currentTime ( ) ;
819
+ let _countDownTime = this . Player . duration ( ) - Math . floor ( this . Player . currentTime ( ) ) ;
828
820
let _m_down = PLAYER_MODULE_BRIGHTCOVE . parseNumber ( Math . floor ( _countDownTime / 60 ) ) ;
829
821
let _s_down = PLAYER_MODULE_BRIGHTCOVE . parseNumber ( Math . floor ( _countDownTime % 60 ) ) ;
830
822
// @ts -ignore
@@ -876,7 +868,7 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
876
868
if ( path ) {
877
869
this . Player . poster ( path ) ;
878
870
} else {
879
- if ( this . CONFIG . poster != false ) this . state . poster = this . Player . poster ( ) ;
871
+ if ( this . CONFIG . poster != false ) this . state . poster = this . GetPoster ( ) ;
880
872
881
873
if ( this . $ . uiDisplayPoster ) {
882
874
if ( this . CONFIG . mode == 'audio' ) {
0 commit comments