Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7705007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:47:56+00:00 2026-05-31T23:47:56+00:00

I am developing a page in which i have to show video with its

  • 0

I am developing a page in which i have to show video with its related pdf.
I have used pdf.js and video.js projects for reading pdf and video respectively.
They both are implemented in different div. this is the link of my page’s screenshot here .I need to implement a function which checks for video current time and change the position of the pdf div according to time
below is the code i implemented but its not working at all

//function to perform on every timeupdate
var myFunc =function(){
    var myPlayer = this;
    var whereYouAt = myPlayer.currentTime();
//working of function
switch(whereYouAt)
{
    case 30: bookmarkscroll('pageContainer2');
         break;
    case 60: bookmarkscroll('pageContainer3');
         break;
    case 90: bookmarkscroll('pageContainer4');
         break;
    case 120: bookmarkscroll('pageContainer5');
          break;
    case 150: bookmarkscroll('pageContainer6');
          break;
    case 180: bookmarkscroll('pageContainer7');
          break;

}

};
myPlayer.addEvent("timeupdate",myFunc);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:47:57+00:00Added an answer on May 31, 2026 at 11:47 pm

    Since the timeupdate event does not care about nice looking decimal numbers and might fire at any given time and even at different intervals depending on your browser (therefore return something like 12.56661) you should change your handling of the value that currentTime (which is also a property and not a method – therefore no () – see this doc) returns.

    Something like this should work:

    //select video player only once
    var myPlayer = document.getElementById('videoPlayer');
    
    //function to perform on every timeupdate
    var myFunc =function(){
    
    var whereYouAt = myPlayer.currentTime; 
    
    if (whereYouAt > 30 && whereYouAt <= 60){
       bookmarkscroll('pageContainer2');
    } else if (whereYouAt > 60 && whereYouAt <= 90){
       bookmarkscroll('pageContainer3');
    } else if .... //and so on
    
    }
    
    myPlayer.addEventListener('timeupdate',myFunc,false);
    

    Another thing to note is that the method for attaching event listeners is called addEventListener and not addEvent

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an iPhone application in which I have a page in which
I am developing web pages which reference external links/images/stylesheets etc. I have 1 page
I'm developing a web page in Asp.Net 1.1 and have a DataGrid which allows
I am developing an asp web page in which I have a drop down
I am developing a website by ASP.Net. I have created settings/first-run page which I
I'm developing web page which has main file index.php as follows: include('UserClass.php'); include('html/top.php'); $user
I am developing a web application which will be added as a custom page
I'm currently developing an ASP.NET page report. I am looking for a chart which
I am developing an events page using jquery mobile. I have a stylish way
I am developing a aspx page. In the page I have three dropdownlists and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.