Comments (3)
There's no API that does blob yet, but it shouldn't be too hard to introduce a mediasource
streamtype.
Just to be clear, are you talking about creating a MediaSource
object and have the object URL be assigned to the video
src property?
from indigo-player.
Yes exactly like MediaSource
I found this solution on Mozilla MediaSource web API
var video = document.querySelector('video');
var assetURL = 'frag_bunny.mp4';
// Need to be specific for Blink regarding codecs
// ./mp4info frag_bunny.mp4 | grep Codec
var mimeCodec = 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"';
if ('MediaSource' in window && MediaSource.isTypeSupported(mimeCodec)) {
var mediaSource = new MediaSource();
//console.log(mediaSource.readyState); // closed
video.src = URL.createObjectURL(mediaSource);
mediaSource.addEventListener('sourceopen', sourceOpen);
} else {
console.error('Unsupported MIME type or codec: ', mimeCodec);
}
function sourceOpen () {
//console.log(this.readyState); // open
var mediaSource = this;
var sourceBuffer = mediaSource.addSourceBuffer(mimeCodec);
fetchAB(assetURL, function (buf) {
sourceBuffer.addEventListener('updateend', function () {
mediaSource.endOfStream();
video.play();
//console.log(mediaSource.readyState); // ended
});
sourceBuffer.appendBuffer(buf);
});
};
function fetchAB (url, cb) {
console.log(url);
var xhr = new XMLHttpRequest;
xhr.open('get', url);
xhr.responseType = 'arraybuffer';
xhr.onload = function () {
cb(xhr.response);
};
xhr.send();
};
But it uses some specific codec formats which are not supported by some mp4 videos. Can you check this and add this in media player so that it automatically checks each codec format for the given video and then show the blob URL in the video src property? Or can we add this option without a specific codec format of the video?
Because if I used one mp4 video for my website maybe the other video format will be WebM which have a different codec format.
from indigo-player.
This MediaSource API works perfectly for this "frag_bunny.mp4" video. I have tried to use other videos but its getting error on every video. Means mostly downloaded videos don't have the same audio and video codec format like this one "avc1.42E01E, mp4a.40.2"
from indigo-player.
Related Issues (20)
- Firefox not loading custom ThumbnailExtension
- Autoplay even if autoplay is set to false
- crossorigin attribute configuration
- Can't seek when two players are in one page
- full screen doesnt work on mobile
- sorry.... i mistaked.... :((((
- Live Indicator
- Quality Labels HOT 1
- theme.css is automatically loaded when imported as a module HOT 1
- Vertical cropping
- IMA Advertising in PIP-mode
- player often hangs on navigation HOT 3
- google drive support?
- Can we add multiple audio to hls?
- Missing return types in src/{index.d.ts,types.ts}
- Missing init function in src/{index.d.ts}
- Poster image.
- fit to screen
- Play videos one after the another based on the queue in Indigo player
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from indigo-player.