File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -25,14 +25,16 @@ $(document).ready(function() {
2525 store_video_time ( contents_by_time ) ;
2626 var time_arr_length = video_time . length ;
2727 var total_duration ;
28- player . on ( 'ready' , event => {
28+ player . on ( 'ready loadedmetadata ' , event => {
2929 total_duration = parseInt ( player . duration ) ;
30- start_tracker ( ( total_duration * 1000 ) / 4 , player ) ;
30+ $ ( "#video_duration" ) . val ( get_time_in_hrs ( total_duration ) ) ;
31+ if ( total_duration > 0 ) {
32+ start_tracker ( ( total_duration * 1000 ) / 4 , player ) ;
33+ }
3134 } ) ;
3235
3336 player . on ( 'timeupdate' , event => {
3437 var current_time = player . currentTime ;
35- $ ( "#video_duration" ) . val ( get_time_in_hrs ( total_duration ) ) ;
3638 $ ( "#current_video_time" ) . val ( get_time_in_hrs ( current_time ) ) ;
3739 if ( time_arr_length > 0 && current_time >= video_time [ loc ] ) {
3840 var content = contents_by_time [ loc ] ;
You can’t perform that action at this time.
0 commit comments