@stremio/stremio-video 0.0.26 → 0.0.28

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.26",
3
+ "version": "0.0.28",
4
4
  "description": "Abstraction layer on top of different media players",
5
5
  "author": "Smart Code OOD",
6
6
  "main": "src/index.js",
@@ -23,6 +23,7 @@ function HTMLVideo(options) {
23
23
  videoElement.style.height = '100%';
24
24
  videoElement.style.backgroundColor = 'black';
25
25
  videoElement.controls = false;
26
+ videoElement.playsInline = true;
26
27
  videoElement.onerror = function() {
27
28
  onVideoError();
28
29
  };
@@ -28,6 +28,7 @@ function YouTubeVideo(options) {
28
28
  onPropChanged('time');
29
29
  onPropChanged('volume');
30
30
  onPropChanged('muted');
31
+ onPropChanged('playbackSpeed');
31
32
  }, timeChangedTimeout);
32
33
 
33
34
  var video = null;
@@ -46,6 +47,7 @@ function YouTubeVideo(options) {
46
47
  buffering: false,
47
48
  volume: false,
48
49
  muted: false,
50
+ playbackSpeed: false,
49
51
  subtitlesTracks: false,
50
52
  selectedSubtitlesTrackId: false
51
53
  };
@@ -165,6 +167,7 @@ function YouTubeVideo(options) {
165
167
  onPropChanged('buffering');
166
168
  onPropChanged('volume');
167
169
  onPropChanged('muted');
170
+ onPropChanged('playbackSpeed');
168
171
  onPropChanged('subtitlesTracks');
169
172
  onPropChanged('selectedSubtitlesTrackId');
170
173
  }
@@ -240,6 +243,13 @@ function YouTubeVideo(options) {
240
243
 
241
244
  return video.isMuted();
242
245
  }
246
+ case 'playbackSpeed': {
247
+ if (stream === null || typeof video.getPlaybackRate !== 'function' || video.getPlaybackRate() === null || !isFinite(video.getPlaybackRate())) {
248
+ return null;
249
+ }
250
+
251
+ return video.getPlaybackRate();
252
+ }
243
253
  case 'subtitlesTracks': {
244
254
  if (stream === null || typeof video.getOption !== 'function') {
245
255
  return [];
@@ -335,6 +345,14 @@ function YouTubeVideo(options) {
335
345
 
336
346
  break;
337
347
  }
348
+ case 'playbackSpeed': {
349
+ if (stream !== null && typeof video.setPlaybackRate === 'function' && isFinite(propValue)) {
350
+ video.setPlaybackRate(propValue);
351
+ onPropChanged('playbackSpeed');
352
+ }
353
+
354
+ break;
355
+ }
338
356
  case 'selectedSubtitlesTrackId': {
339
357
  if (stream !== null) {
340
358
  selectedSubtitlesTrackId = null;
@@ -388,6 +406,7 @@ function YouTubeVideo(options) {
388
406
  onPropChanged('buffering');
389
407
  onPropChanged('volume');
390
408
  onPropChanged('muted');
409
+ onPropChanged('playbackSpeed');
391
410
  onPropChanged('subtitlesTracks');
392
411
  onPropChanged('selectedSubtitlesTrackId');
393
412
  } else {
@@ -417,6 +436,7 @@ function YouTubeVideo(options) {
417
436
  onPropChanged('buffering');
418
437
  onPropChanged('volume');
419
438
  onPropChanged('muted');
439
+ onPropChanged('playbackSpeed');
420
440
  onPropChanged('subtitlesTracks');
421
441
  onPropChanged('selectedSubtitlesTrackId');
422
442
  break;
@@ -477,7 +497,7 @@ YouTubeVideo.canPlayStream = function(stream) {
477
497
  YouTubeVideo.manifest = {
478
498
  name: 'YouTubeVideo',
479
499
  external: false,
480
- props: ['stream', 'loaded', 'paused', 'time', 'duration', 'buffering', 'volume', 'muted', 'subtitlesTracks', 'selectedSubtitlesTrackId'],
500
+ props: ['stream', 'loaded', 'paused', 'time', 'duration', 'buffering', 'volume', 'muted', 'playbackSpeed', 'subtitlesTracks', 'selectedSubtitlesTrackId'],
481
501
  commands: ['load', 'unload', 'destroy'],
482
502
  events: ['propValue', 'propChanged', 'ended', 'error', 'subtitlesTrackLoaded']
483
503
  };
package/src/error.js CHANGED
@@ -58,7 +58,7 @@ var ERROR = {
58
58
  WITH_STREAMING_SERVER: {
59
59
  CONVERT_FAILED: {
60
60
  code: 60,
61
- message: 'Streaming server failed to convert torrent stream'
61
+ message: 'Your device does not support the stream'
62
62
  }
63
63
  },
64
64
  UNKNOWN_ERROR: {