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() {
25
25
store_video_time ( contents_by_time ) ;
26
26
var time_arr_length = video_time . length ;
27
27
var total_duration ;
28
- player . on ( 'ready' , event => {
28
+ player . on ( 'ready loadedmetadata ' , event => {
29
29
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
+ }
31
34
} ) ;
32
35
33
36
player . on ( 'timeupdate' , event => {
34
37
var current_time = player . currentTime ;
35
- $ ( "#video_duration" ) . val ( get_time_in_hrs ( total_duration ) ) ;
36
38
$ ( "#current_video_time" ) . val ( get_time_in_hrs ( current_time ) ) ;
37
39
if ( time_arr_length > 0 && current_time >= video_time [ loc ] ) {
38
40
var content = contents_by_time [ loc ] ;
You can’t perform that action at this time.
0 commit comments