@stremio/stremio-video 0.0.25-rc.2 → 0.0.25-rc.3

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stremio/stremio-video",
3
- "version": "0.0.25-rc.2",
3
+ "version": "0.0.25-rc.3",
4
4
  "description": "Abstraction layer on top of different media players",
5
5
  "author": "Smart Code OOD",
6
6
  "main": "src/index.js",
@@ -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 areStreamsSupported = probe.streams.every(function(stream) {
363
- if (stream.track === 'audio') {
364
- return stream.channels <= options.maxAudioChannels &&
365
- options.audioCodecs.indexOf(stream.codec) !== -1;
366
- } else if (stream.track === 'video') {
367
- return options.videoCodecs.indexOf(stream.codec) !== -1;
368
- }
369
-
370
- return true;
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 && areStreamsSupported;
375
+ return isFormatSupported && areVideoStreamsSupported && areAudioStreamsSupported;
373
376
  });
374
377
  });
375
378
  };