
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
HTML5 video full preload in JavaScript
Use the oncanplaythrough event to completely preload video. You can try to run the following code.
Example
<!DOCTYPE html> <html> <body> <video id="myVideo" width="400" height="200" controls oncanplaythrough="display()"> <source src="/html5/foo.ogg" type="video/ogg" /> <source src="/html5/foo.mp4" type="video/mp4" /> Your browser does not support the video element. </video> <script> function display() { alert("Can be played without pausing for buffering."); } </script> </body> </html>
- Related Articles
- HTML5 preload attribute
- HTML DOM Video preload Property
- HTML5 video not playing in Firefox
- Commonly used Video formats while using HTML5 video
- How to take a snapshot of HTML5-JavaScript based video player?
- Display video inside HTML5 canvas
- Facing Problem in retrieving HTML5 video duration
- How to display video control in HTML5?
- Play local (hard-drive) video file with HTML5 video tag?
- Play infinitely looping video on-load in HTML5
- Playing MP4 video in WebView using HTML5 in Android
- Setting Up Full Video Background using video.js
- HTML5 Video Tag in Chrome - Why is currentTime ignored when video downloaded from my webserver?
- HTML5 inline video on iPhone vs iPad/Browser
- Converting video to HTML5 ogg / ogv and mpg4

Advertisements