- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
XMLHttpRequest for Video Tag?
The HTML5 file Blob.slice() method is useful for creating a Blob object containing the data. This data is in the specified range of bytes of the source Blob. It uses XMLHttpRequest as in the below example.
Let us see an example to send and receive binary data using slice(). This example sends a text and uses the POST method to send the "file" to the server:
var val = new XMLHttpRequest(); val.open("POST", url, true); val.onload = function (event) { }; var blob = new Blob(['demo'], {type: 'text/plain'}); val.send(blob);
For video:
req.onload = function () { var blob_uri = URL.createObjectURL(this.response); myElement.appendChild(document.createElement("source")).src = blob_uri; }; req.responseType = "blob";
- Related Articles
- Play local (hard-drive) video file with HTML5 video tag?
- Hide a video tag on a web page - JavaScript
- HTML5 Video Tag in Chrome - Why is currentTime ignored when video downloaded from my webserver?
- Researching for Your Next YouTube Video
- How to generate captions for a video?
- How to optimize video for YouTube search?
- HTML5 tag on Android for PhoneGap application
- How to send a file and parameters within the same XMLHttpRequest
- Using FFMPEG with HTML5 for online video hosting
- How to Use YouTube Analytics for Video Optimization?
- ffmpeg settings for converting to mp4 and ogg for HTML5 video
- HTML Viewport meta tag for Responsive Web Design
- Video Ads for Mobile Devices – A Successful Recipe for Your Digital Campaign
- Use CSS width property for a responsive video player
- Use CSS max-width property responsive for video player

Advertisements