@stremio/stremio-video 0.0.21 → 0.0.23

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.
@@ -0,0 +1,3 @@
1
+ var WebOsVideo = require('./WebOsVideo');
2
+
3
+ module.exports = WebOsVideo;
@@ -39,6 +39,7 @@ function YouTubeVideo(options) {
39
39
  var selectedSubtitlesTrackId = null;
40
40
  var observedProps = {
41
41
  stream: false,
42
+ loaded: false,
42
43
  paused: false,
43
44
  time: false,
44
45
  duration: false,
@@ -190,6 +191,13 @@ function YouTubeVideo(options) {
190
191
  case 'stream': {
191
192
  return stream;
192
193
  }
194
+ case 'loaded': {
195
+ if (stream === null) {
196
+ return null;
197
+ }
198
+
199
+ return true;
200
+ }
193
201
  case 'paused': {
194
202
  if (stream === null || typeof video.getPlayerState !== 'function') {
195
203
  return null;
@@ -360,6 +368,7 @@ function YouTubeVideo(options) {
360
368
  if (ready) {
361
369
  stream = commandArgs.stream;
362
370
  onPropChanged('stream');
371
+ onPropChanged('loaded');
363
372
  var autoplay = typeof commandArgs.autoplay === 'boolean' ? commandArgs.autoplay : true;
364
373
  var time = commandArgs.time !== null && isFinite(commandArgs.time) ? parseInt(commandArgs.time, 10) / 1000 : 0;
365
374
  if (autoplay && typeof video.loadVideoById === 'function') {
@@ -397,6 +406,7 @@ function YouTubeVideo(options) {
397
406
  pendingLoadArgs = null;
398
407
  stream = null;
399
408
  onPropChanged('stream');
409
+ onPropChanged('loaded');
400
410
  selectedSubtitlesTrackId = null;
401
411
  if (ready && typeof video.stopVideo === 'function') {
402
412
  video.stopVideo();
@@ -467,7 +477,7 @@ YouTubeVideo.canPlayStream = function(stream) {
467
477
  YouTubeVideo.manifest = {
468
478
  name: 'YouTubeVideo',
469
479
  external: false,
470
- props: ['stream', 'paused', 'time', 'duration', 'buffering', 'volume', 'muted', 'subtitlesTracks', 'selectedSubtitlesTrackId'],
480
+ props: ['stream', 'loaded', 'paused', 'time', 'duration', 'buffering', 'volume', 'muted', 'subtitlesTracks', 'selectedSubtitlesTrackId'],
471
481
  commands: ['load', 'unload', 'destroy'],
472
482
  events: ['propValue', 'propChanged', 'ended', 'error', 'subtitlesTrackLoaded']
473
483
  };