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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:26:24+00:00 2026-06-17T03:26:24+00:00

I just copied some sample from book HTML5 Canvas, which loads video in the

  • 0

I just copied some sample from book HTML5 Canvas, which loads video in the javascript and show that video on Canvas;

the Basic code is as following:

videoElement = document.createElement("video");
videoDiv = document.createElement("div");
document.body.appendChild(videoDiv);
videoDiv.appendChild(videoElement);

videoElement.setAttribute("src", "url to the video");
videoElement.addEventListener("canplaythrough", videoLoaded, false);

suppose the videoLoaded should be called after when loading video, but it isn’t;

I checked it in firebug, it shows that the browser just keeps loading the video, but no content fetched;

I just upgrade firefox from v17 to v18.

And it worked in V17.

Could some help me out of this? thanks.

  • 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-17T03:26:26+00:00Added an answer on June 17, 2026 at 3:26 am

    Try setting the source without the “setAttribute” function. You will also need to enable the controls in order for most browsers to actual run.

    Replace:

    videoElement.setAttribute("src", "url to the video");
    

    with:

    videoElement.src = 'http://static.bouncingminds.com/ads/5secs/baileys_5sec.mp4';
    videoElement.width = 320;
    videoElement.height = 240;
    videoElement.controls = true;
    

    There are other options you can apply to the video tag, one of which I’d suggest considering is “preload”

    All works on Chrome with the above code… I also suggest not relying on HTML5 as all browsers do not support. There are a few good fallback options such as VideoJS and JWPlayer which will play what browsers support rather than forcing HTML5 or Flash

    edit: I just noticed “FireFox” — replace the .mp4 video with something else, FF doesn’t play well with mp4’s

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

Sidebar

Related Questions

Some websites now use a JavaScript service from Tynt that appends text to copied
I have this html page I copied from here . There is a javascript
I just copied my current database to a new database to find out only
I have just started using RSpec and I copied the very simple test on
Is objects enqueued to a ConcurrentQueue are copied to the queue or just their
Just to make sure I'm understanding shallow copies of reference types correctly and that
just wanted to ask where I define initial class properties? From other languages I
Just a knowledge question which I would like to ask: For example, I have
Recently, I was trying to prototype some jQuery-based menu into ASP.NET MVC. Just to
I am using v5.4.1.0 of the facebook c# sdk and the 'CS-Canvas-AspNetMvc3-JsSdk' sample. I

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.