@stremio/stremio-video 0.0.18 → 0.0.19-rc.1

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.18",
3
+ "version": "0.0.19-rc.1",
4
4
  "description": "Abstraction layer on top of different media players",
5
5
  "author": "Smart Code OOD",
6
6
  "main": "src/index.js",
@@ -73,18 +73,26 @@ function IFrameVideo(options) {
73
73
  command('unload');
74
74
  if (commandArgs && commandArgs.stream && typeof commandArgs.stream.playerFrameUrl === 'string') {
75
75
  window.addEventListener('message', onMessage, false);
76
+ iframeElement.onload = function() {
77
+ sendMessage({
78
+ type: 'command',
79
+ commandName: commandName,
80
+ commandArgs: commandArgs
81
+ });
82
+ };
76
83
  iframeElement.src = commandArgs.stream.playerFrameUrl;
77
- return false;
78
84
  } else {
79
85
  onError(Object.assign({}, ERROR.UNSUPPORTED_STREAM, {
80
86
  critical: true,
81
87
  stream: commandArgs ? commandArgs.stream : null
82
88
  }));
83
- return true;
84
89
  }
90
+
91
+ return true;
85
92
  }
86
93
  case 'unload': {
87
94
  window.removeEventListener('message', onMessage);
95
+ iframeElement.onload = null;
88
96
  iframeElement.removeAttribute('src');
89
97
  onPropChanged('stream', null);
90
98
  onPropChanged('paused', null);