@scarlett-player/native 0.2.0 → 0.4.0
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/dist/index.cjs +5 -1
- package/dist/index.js +5 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -82,7 +82,7 @@ function createNativePlugin(config) {
|
|
|
82
82
|
return video;
|
|
83
83
|
}
|
|
84
84
|
video = document.createElement("video");
|
|
85
|
-
video.style.cssText = "width:100%;height:100%;display:block;object-fit:contain;background:#000";
|
|
85
|
+
video.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;display:block;object-fit:contain;background:#000";
|
|
86
86
|
video.preload = preload;
|
|
87
87
|
video.controls = false;
|
|
88
88
|
video.playsInline = true;
|
|
@@ -304,6 +304,10 @@ function createNativePlugin(config) {
|
|
|
304
304
|
const onLoaded = () => {
|
|
305
305
|
videoEl.removeEventListener("loadedmetadata", onLoaded);
|
|
306
306
|
videoEl.removeEventListener("error", onError);
|
|
307
|
+
const muted = api?.getState("muted");
|
|
308
|
+
const volume = api?.getState("volume");
|
|
309
|
+
if (muted !== void 0) videoEl.muted = muted;
|
|
310
|
+
if (volume !== void 0) videoEl.volume = volume;
|
|
307
311
|
api?.setState("source", { src, type: mimeType });
|
|
308
312
|
api?.setState("playbackState", "ready");
|
|
309
313
|
api?.setState("buffering", false);
|
package/dist/index.js
CHANGED
|
@@ -57,7 +57,7 @@ function createNativePlugin(config) {
|
|
|
57
57
|
return video;
|
|
58
58
|
}
|
|
59
59
|
video = document.createElement("video");
|
|
60
|
-
video.style.cssText = "width:100%;height:100%;display:block;object-fit:contain;background:#000";
|
|
60
|
+
video.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;display:block;object-fit:contain;background:#000";
|
|
61
61
|
video.preload = preload;
|
|
62
62
|
video.controls = false;
|
|
63
63
|
video.playsInline = true;
|
|
@@ -279,6 +279,10 @@ function createNativePlugin(config) {
|
|
|
279
279
|
const onLoaded = () => {
|
|
280
280
|
videoEl.removeEventListener("loadedmetadata", onLoaded);
|
|
281
281
|
videoEl.removeEventListener("error", onError);
|
|
282
|
+
const muted = api?.getState("muted");
|
|
283
|
+
const volume = api?.getState("volume");
|
|
284
|
+
if (muted !== void 0) videoEl.muted = muted;
|
|
285
|
+
if (volume !== void 0) videoEl.volume = volume;
|
|
282
286
|
api?.setState("source", { src, type: mimeType });
|
|
283
287
|
api?.setState("playbackState", "ready");
|
|
284
288
|
api?.setState("buffering", false);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scarlett-player/native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Native Video Provider Plugin for Scarlett Player (MP4, WebM, MOV, MKV)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@scarlett-player/core": "^0.
|
|
20
|
+
"@scarlett-player/core": "^0.4.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"typescript": "^5.3.0",
|
|
24
24
|
"tsup": "^8.0.0",
|
|
25
25
|
"vitest": "^1.6.0",
|
|
26
|
-
"@scarlett-player/core": "0.
|
|
26
|
+
"@scarlett-player/core": "0.4.0"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|
|
29
29
|
"video",
|