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 8499197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:36:10+00:00 2026-06-11T00:36:10+00:00

Can you give me an example for Chrome where I have something like this:

  • 0

Can you give me an example for Chrome where I have something like this:

function checkVideoStatus(vidElement){
   var currentTime = vidElement.currentTime;
   //now wait 5 seconds
   var updatedTime = vidElement.currentTime;
   //now check if video has freezed
   if(updatedTime == currentTime){
      //fire videoFreeze Event
   }

}

So I would want to fire this event here. Also, is it really necessary to fire this event, since I already can put a relevant method call here to do what I want accordingly?

Is it in JS the events are only like onChange, onMouseOver etc?

  • 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-06-11T00:36:11+00:00Added an answer on June 11, 2026 at 12:36 am

    This is a simple mockup of a custom event and a countdown.

    <div id="vid" data-current="0">Video</div>​
    
    var vid = document.getElementById('vid'),
        freeze;
    
    vid.addEventListener('freeze', function() {
        console.log('Firing vid.freeze.... ' + this.dataset.current);
        console.log('vid.freeze fired.');
    });
    
    (function go() {
        var status;
        vid.innerHTML = 'Video time: ' + vid.dataset.current;
    
        if (vid.dataset.current < 5) {
            status = vid.dataset.current == 0 ? 'Starting... ' : 'Continuing... ';
            console.log(status + vid.dataset.current);
            setTimeout(go, 1000);
        } else {
            freeze = document.createEvent('CustomEvent');
            freeze.initEvent('freeze', true, true);
            vid.dispatchEvent(freeze);
        }
    
        vid.dataset.current++;
    })();​
    

    http://jsfiddle.net/userdude/Ampbm/1

    This is mostly to show how to make a custom event which fires after five seconds. I’m also using the data- attribute to store the current time. What you’re doing in the if block I’m not quite sure about, since .updatedTime and .currentTime seems to me to be possibly the same thing each go round.

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

Sidebar

Related Questions

Do anyone can give example of function composition? This is the definition of function
This is a nasty one. I have an external link. <a href=http://www.example.com target=_blank> now
In the chrome console, I can't run any loops. Why is this? For example,
Can you give an example where the Queue data structure can be specially helpful
Can someone give an example for finding greatest common divisor algorithm for more than
Can you give an example of stack overflow in C++?
Can someone give an example of how thread deadlock can be caused in the
Can anybody give an example of c++ code that can easily convert a decimal
Can anybody give any working example of how to read/write Unicode text files using
Can anyone give me an example of these attributes in action: stroke-dasharray, stroke-linecap, stroke-linejoin

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.