summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authoradityacp2020-11-12 21:40:56 +0530
committeradityacp2020-11-12 21:46:37 +0530
commit0a4554d28b3901f40fe88d9df1ea899e8c18f3fe (patch)
tree1fdb50c8c16d85d8b61a7c793aadfaa93235c22e /yaksh
parent0cf9c577125b400610bd51fff32d4a9de0dca946 (diff)
downloadonline_test-0a4554d28b3901f40fe88d9df1ea899e8c18f3fe.tar.gz
online_test-0a4554d28b3901f40fe88d9df1ea899e8c18f3fe.tar.bz2
online_test-0a4554d28b3901f40fe88d9df1ea899e8c18f3fe.zip
Add separate event for the videos other than youtube
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/static/yaksh/js/show_toc.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/yaksh/static/yaksh/js/show_toc.js b/yaksh/static/yaksh/js/show_toc.js
index be08e78..914ab1c 100644
--- a/yaksh/static/yaksh/js/show_toc.js
+++ b/yaksh/static/yaksh/js/show_toc.js
@@ -25,14 +25,16 @@ $(document).ready(function() {
store_video_time(contents_by_time);
var time_arr_length = video_time.length;
var total_duration;
- player.on('ready', event => {
+ player.on('ready loadedmetadata', event => {
total_duration = parseInt(player.duration);
- start_tracker((total_duration * 1000) / 4, player);
+ $("#video_duration").val(get_time_in_hrs(total_duration));
+ if (total_duration > 0) {
+ start_tracker((total_duration * 1000) / 4, player);
+ }
});
player.on('timeupdate', event => {
var current_time = player.currentTime;
- $("#video_duration").val(get_time_in_hrs(total_duration));
$("#current_video_time").val(get_time_in_hrs(current_time));
if (time_arr_length > 0 && current_time >= video_time[loc]) {
var content = contents_by_time[loc];