av-merge: Specify which of MediaSource, audio, or video are unsupported
Signed-off-by: Jesús <heckyel@hyperbola.info>
This commit is contained in:
parent
5bf4c284a5
commit
12561c0ed3
@ -39,16 +39,26 @@ function AVMerge(video, srcPair, startTime){
|
||||
this.setup();
|
||||
}
|
||||
AVMerge.prototype.setup = function() {
|
||||
if ('MediaSource' in window
|
||||
&& MediaSource.isTypeSupported(this.audioSource['mime_codec'])
|
||||
&& MediaSource.isTypeSupported(this.videoSource['mime_codec'])) {
|
||||
if (!('MediaSource' in window)) {
|
||||
reportError('MediaSource not supported.');
|
||||
return;
|
||||
}
|
||||
var audioSupported = MediaSource.isTypeSupported(
|
||||
this.audioSource['mime_codec']
|
||||
)
|
||||
var videoSupported = MediaSource.isTypeSupported(
|
||||
this.videoSource['mime_codec']
|
||||
)
|
||||
if (!audioSupported)
|
||||
reportError('Unsupported MIME type or codec: ',
|
||||
this.audioSource['mime_codec']);
|
||||
if (!videoSupported)
|
||||
reportError('Unsupported MIME type or codec: ',
|
||||
this.videoSource['mime_codec']);
|
||||
if (audioSupported && videoSupported) {
|
||||
this.mediaSource = new MediaSource();
|
||||
this.video.src = URL.createObjectURL(this.mediaSource);
|
||||
this.mediaSource.onsourceopen = this.sourceOpen.bind(this);
|
||||
} else {
|
||||
reportError('Unsupported MIME type or codec: ',
|
||||
this.audioSource['mime_codec'],
|
||||
this.videoSource['mime_codec']);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user