@scarlett-player/native 0.1.1 → 0.1.2
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 +4 -1
- package/dist/index.js +4 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -24,6 +24,7 @@ __export(index_exports, {
|
|
|
24
24
|
default: () => index_default
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(index_exports);
|
|
27
|
+
var import_core = require("@scarlett-player/core");
|
|
27
28
|
var SUPPORTED_EXTENSIONS = ["mp4", "webm", "mov", "mkv", "ogv", "ogg", "m4v"];
|
|
28
29
|
var MIME_TYPES = {
|
|
29
30
|
mp4: "video/mp4",
|
|
@@ -162,7 +163,7 @@ function createNativePlugin(config) {
|
|
|
162
163
|
}
|
|
163
164
|
api?.logger.error("Video error", { code: error?.code, message });
|
|
164
165
|
api?.emit("error", {
|
|
165
|
-
code:
|
|
166
|
+
code: import_core.ErrorCode.PLAYBACK_FAILED,
|
|
166
167
|
message,
|
|
167
168
|
fatal: true,
|
|
168
169
|
timestamp: Date.now()
|
|
@@ -254,6 +255,8 @@ function createNativePlugin(config) {
|
|
|
254
255
|
cleanup();
|
|
255
256
|
api.setState("playbackState", "loading");
|
|
256
257
|
api.setState("buffering", true);
|
|
258
|
+
api.setState("qualities", []);
|
|
259
|
+
api.setState("currentQuality", null);
|
|
257
260
|
const videoEl = getOrCreateVideo();
|
|
258
261
|
cleanupEvents = setupEventListeners(videoEl);
|
|
259
262
|
return new Promise((resolve, reject) => {
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
+
import { ErrorCode } from "@scarlett-player/core";
|
|
2
3
|
var SUPPORTED_EXTENSIONS = ["mp4", "webm", "mov", "mkv", "ogv", "ogg", "m4v"];
|
|
3
4
|
var MIME_TYPES = {
|
|
4
5
|
mp4: "video/mp4",
|
|
@@ -137,7 +138,7 @@ function createNativePlugin(config) {
|
|
|
137
138
|
}
|
|
138
139
|
api?.logger.error("Video error", { code: error?.code, message });
|
|
139
140
|
api?.emit("error", {
|
|
140
|
-
code:
|
|
141
|
+
code: ErrorCode.PLAYBACK_FAILED,
|
|
141
142
|
message,
|
|
142
143
|
fatal: true,
|
|
143
144
|
timestamp: Date.now()
|
|
@@ -229,6 +230,8 @@ function createNativePlugin(config) {
|
|
|
229
230
|
cleanup();
|
|
230
231
|
api.setState("playbackState", "loading");
|
|
231
232
|
api.setState("buffering", true);
|
|
233
|
+
api.setState("qualities", []);
|
|
234
|
+
api.setState("currentQuality", null);
|
|
232
235
|
const videoEl = getOrCreateVideo();
|
|
233
236
|
cleanupEvents = setupEventListeners(videoEl);
|
|
234
237
|
return new Promise((resolve, reject) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scarlett-player/native",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Native Video Provider Plugin for Scarlett Player (MP4, WebM, MOV, MKV)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@scarlett-player/core": "^0.1.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@scarlett-player/core": "
|
|
29
|
+
"@scarlett-player/core": "workspace:*",
|
|
30
30
|
"typescript": "^5.3.0",
|
|
31
31
|
"tsup": "^8.0.0",
|
|
32
32
|
"vitest": "^1.6.0"
|