@stremio/stremio-video 0.0.25-rc.2 → 0.0.25-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/mediaCapabilities.js
CHANGED
|
@@ -67,7 +67,7 @@ function getMaxAudioChannels() {
|
|
|
67
67
|
|
|
68
68
|
function getMediaCapabilities() {
|
|
69
69
|
var mediaElement = document.createElement('video');
|
|
70
|
-
var formats = ['mp4'];
|
|
70
|
+
var formats = ['mp4', 'webm'];
|
|
71
71
|
var videoCodecs = VIDEO_CODEC_CONFIGS
|
|
72
72
|
.map(function(config) {
|
|
73
73
|
return canPlay(config, { mediaElement: mediaElement });
|
|
@@ -359,17 +359,20 @@ function withStreamingServer(Video) {
|
|
|
359
359
|
var isFormatSupported = options.formats.some(function(format) {
|
|
360
360
|
return probe.format.name.indexOf(format) !== -1;
|
|
361
361
|
});
|
|
362
|
-
var
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
362
|
+
var videoStreams = probe.streams.filter(function(stream) {
|
|
363
|
+
return stream.track === 'video';
|
|
364
|
+
});
|
|
365
|
+
var areVideoStreamsSupported = videoStreams.length === 0 || videoStreams.some(function(stream) {
|
|
366
|
+
return options.videoCodecs.indexOf(stream.codec) !== -1;
|
|
367
|
+
});
|
|
368
|
+
var audioStreams = probe.streams.filter(function(stream) {
|
|
369
|
+
return stream.track === 'audio';
|
|
370
|
+
});
|
|
371
|
+
var areAudioStreamsSupported = audioStreams.length === 0 || audioStreams.some(function(stream) {
|
|
372
|
+
return stream.channels <= options.maxAudioChannels &&
|
|
373
|
+
options.audioCodecs.indexOf(stream.codec) !== -1;
|
|
371
374
|
});
|
|
372
|
-
return isFormatSupported &&
|
|
375
|
+
return isFormatSupported && areVideoStreamsSupported && areAudioStreamsSupported;
|
|
373
376
|
});
|
|
374
377
|
});
|
|
375
378
|
};
|