@hopeplayer/vue 1.0.15 → 1.0.16
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/HopePlayer.vue.d.ts
CHANGED
|
@@ -19,6 +19,12 @@ declare const __VLS_export: import("vue").DefineComponent<HopePlayerOptions, {
|
|
|
19
19
|
adend: (type: "preroll" | "midroll" | "postroll") => any;
|
|
20
20
|
aderror: (message: string) => any;
|
|
21
21
|
itemchange: (index: number, source: "playlist" | "story") => any;
|
|
22
|
+
sourcefallback: (detail: {
|
|
23
|
+
from: import("@hopeplayer/core").HopeSourceFormat;
|
|
24
|
+
to: import("@hopeplayer/core").HopeSourceFormat;
|
|
25
|
+
code?: number;
|
|
26
|
+
skipped?: boolean;
|
|
27
|
+
}) => any;
|
|
22
28
|
}, string, import("vue").PublicProps, Readonly<HopePlayerOptions> & Readonly<{
|
|
23
29
|
onSticky?: ((sticky: boolean, corner: StickyCorner | undefined) => any) | undefined;
|
|
24
30
|
onPlay?: (() => any) | undefined;
|
|
@@ -32,6 +38,12 @@ declare const __VLS_export: import("vue").DefineComponent<HopePlayerOptions, {
|
|
|
32
38
|
onAdend?: ((type: "preroll" | "midroll" | "postroll") => any) | undefined;
|
|
33
39
|
onAderror?: ((message: string) => any) | undefined;
|
|
34
40
|
onItemchange?: ((index: number, source: "playlist" | "story") => any) | undefined;
|
|
41
|
+
onSourcefallback?: ((detail: {
|
|
42
|
+
from: import("@hopeplayer/core").HopeSourceFormat;
|
|
43
|
+
to: import("@hopeplayer/core").HopeSourceFormat;
|
|
44
|
+
code?: number;
|
|
45
|
+
skipped?: boolean;
|
|
46
|
+
}) => any) | undefined;
|
|
35
47
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
48
|
declare const _default: typeof __VLS_export;
|
|
37
49
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HopePlayer.vue.d.ts","sourceRoot":"","sources":["../src/HopePlayer.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HopePlayer.vue.d.ts","sourceRoot":"","sources":["../src/HopePlayer.vue"],"names":[],"mappings":"AA8GA,OAAO,KAAK,EAAE,iBAAiB,IAAI,YAAY,EAAsB,iBAAiB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAmF/H,iBAAS,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAE7B;AAED,iBAAS,KAAK,IAAI,IAAI,CAErB;AAED,iBAAS,UAAU,IAAI,YAAY,GAAG,IAAI,CAEzC;AA6BD,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kFAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
package/dist/hope-player-vue.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent as h, ref as m, onMounted as f, watch as
|
|
1
|
+
import { defineComponent as h, ref as m, onMounted as f, watch as g, onBeforeUnmount as b, openBlock as B, createElementBlock as k } from "vue";
|
|
2
2
|
const O = /* @__PURE__ */ h({
|
|
3
3
|
__name: "HopePlayer",
|
|
4
4
|
props: {
|
|
5
5
|
id: {},
|
|
6
6
|
src: {},
|
|
7
7
|
sources: {},
|
|
8
|
+
sourcePriority: {},
|
|
8
9
|
poster: {},
|
|
9
10
|
audio: { type: [Boolean, Object] },
|
|
10
11
|
autoplay: { type: Boolean },
|
|
@@ -21,6 +22,8 @@ const O = /* @__PURE__ */ h({
|
|
|
21
22
|
aspectRatio: {},
|
|
22
23
|
rewardedUnlock: {},
|
|
23
24
|
sponsorship: {},
|
|
25
|
+
adTriggers: {},
|
|
26
|
+
cast: {},
|
|
24
27
|
showRemainingTime: { type: Boolean },
|
|
25
28
|
skipButtons: { type: [Boolean, Object] },
|
|
26
29
|
keyboardSeekStep: {},
|
|
@@ -49,9 +52,9 @@ const O = /* @__PURE__ */ h({
|
|
|
49
52
|
liveWallClock: { type: [Boolean, Object] },
|
|
50
53
|
dai: {}
|
|
51
54
|
},
|
|
52
|
-
emits: ["ready", "play", "pause", "ended", "error", "qualitychange", "ratechange", "adstart", "adend", "aderror", "itemchange", "sticky"],
|
|
55
|
+
emits: ["ready", "play", "pause", "ended", "error", "qualitychange", "ratechange", "adstart", "adend", "aderror", "itemchange", "sticky", "sourcefallback"],
|
|
53
56
|
setup(p, { expose: i, emit: c }) {
|
|
54
|
-
const
|
|
57
|
+
const n = p, t = c, o = m(null);
|
|
55
58
|
let s = !1, l = [];
|
|
56
59
|
f(() => {
|
|
57
60
|
const a = o.value;
|
|
@@ -70,32 +73,33 @@ const O = /* @__PURE__ */ h({
|
|
|
70
73
|
[
|
|
71
74
|
"hp:itemchange",
|
|
72
75
|
(e) => {
|
|
73
|
-
const
|
|
74
|
-
t("itemchange",
|
|
76
|
+
const r = e.detail;
|
|
77
|
+
t("itemchange", r.index, r.source);
|
|
75
78
|
}
|
|
76
79
|
],
|
|
77
80
|
[
|
|
78
81
|
"hp:sticky",
|
|
79
82
|
(e) => {
|
|
80
|
-
const
|
|
81
|
-
t("sticky",
|
|
83
|
+
const r = e.detail;
|
|
84
|
+
t("sticky", r.sticky, r.corner);
|
|
82
85
|
}
|
|
83
|
-
]
|
|
86
|
+
],
|
|
87
|
+
["hp:sourcefallback", (e) => t("sourcefallback", e.detail)]
|
|
84
88
|
];
|
|
85
|
-
for (const [e,
|
|
89
|
+
for (const [e, r] of l) a.addEventListener(e, r);
|
|
86
90
|
import("@hopeplayer/core").then(() => {
|
|
87
|
-
s || !o.value || (o.value.options = { ...
|
|
91
|
+
s || !o.value || (o.value.options = { ...n });
|
|
88
92
|
});
|
|
89
93
|
}
|
|
90
|
-
}),
|
|
91
|
-
() => JSON.stringify(
|
|
94
|
+
}), g(
|
|
95
|
+
() => JSON.stringify(n),
|
|
92
96
|
() => {
|
|
93
|
-
o.value && (o.value.options = { ...
|
|
97
|
+
o.value && (o.value.options = { ...n });
|
|
94
98
|
}
|
|
95
|
-
),
|
|
99
|
+
), b(() => {
|
|
96
100
|
s = !0;
|
|
97
101
|
const a = o.value;
|
|
98
|
-
if (a) for (const [e,
|
|
102
|
+
if (a) for (const [e, r] of l) a.removeEventListener(e, r);
|
|
99
103
|
});
|
|
100
104
|
function d() {
|
|
101
105
|
var a;
|
|
@@ -108,7 +112,7 @@ const O = /* @__PURE__ */ h({
|
|
|
108
112
|
function y() {
|
|
109
113
|
return o.value;
|
|
110
114
|
}
|
|
111
|
-
return i({ play: d, pause: u, getElement: y }), (a, e) => (
|
|
115
|
+
return i({ play: d, pause: u, getElement: y }), (a, e) => (B(), k("hope-player", {
|
|
112
116
|
ref_key: "elRef",
|
|
113
117
|
ref: o
|
|
114
118
|
}, null, 512));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hope-player-vue.js","sources":["../src/HopePlayer.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// <hope-player> için ince Vue sarmalayıcı: prop'ları `.options`'a yazar, `hp:*` event'lerini emit'lere çevirir.\n// class/style Vue'nun fallthrough attribute'larıyla köke geçer. Core `onMounted` içinde dinamik import edilir —\n// statik import `HTMLElement` olmayan SSR'da (Nuxt) çöker.\nimport { ref, onMounted, onBeforeUnmount, watch } from 'vue';\nimport type { HopePlayerElement as HopePlayerEl, HopePlayerEventMap, HopePlayerOptions, StickyCorner } from '@hopeplayer/core';\n\nconst props = defineProps<HopePlayerOptions>();\n\nconst emit = defineEmits<{\n ready: [];\n play: [];\n pause: [];\n ended: [];\n error: [message: string];\n qualitychange: [label: string];\n ratechange: [rate: number];\n adstart: [type: 'preroll' | 'midroll' | 'postroll'];\n adend: [type: 'preroll' | 'midroll' | 'postroll'];\n aderror: [message: string];\n itemchange: [index: number, source: 'playlist' | 'story'];\n sticky: [sticky: boolean, corner: StickyCorner | undefined];\n}>();\n\nconst elRef = ref<HopePlayerEl | null>(null);\nlet cancelled = false;\nlet listeners: Array<[keyof HopePlayerEventMap, EventListener]> = [];\n\nonMounted(() => {\n const el = elRef.value;\n if (!el) return;\n\n // Dinleyiciler import'u beklemeden eklenir: core yüklenince customElements.define() elementi senkron upgrade\n // edip hp:ready'yi .then()'den ÖNCE dispatch ediyor — beklenirse @ready kaçırılır.\n listeners = [\n ['hp:ready', () => emit('ready')],\n ['hp:play', () => emit('play')],\n ['hp:pause', () => emit('pause')],\n ['hp:ended', () => emit('ended')],\n ['hp:error', (e) => emit('error', (e as CustomEvent<{ message: string }>).detail.message)],\n ['hp:qualitychange', (e) => emit('qualitychange', (e as CustomEvent<{ label: string }>).detail.label)],\n ['hp:ratechange', (e) => emit('ratechange', (e as CustomEvent<{ rate: number }>).detail.rate)],\n ['hp:adstart', (e) => emit('adstart', (e as CustomEvent<{ type: 'preroll' | 'midroll' | 'postroll' }>).detail.type)],\n ['hp:adend', (e) => emit('adend', (e as CustomEvent<{ type: 'preroll' | 'midroll' | 'postroll' }>).detail.type)],\n ['hp:aderror', (e) => emit('aderror', (e as CustomEvent<{ message: string }>).detail.message)],\n [\n 'hp:itemchange',\n (e) => {\n const detail = (e as CustomEvent<{ index: number; source: 'playlist' | 'story' }>).detail;\n emit('itemchange', detail.index, detail.source);\n },\n ],\n [\n 'hp:sticky',\n (e) => {\n const detail = (e as CustomEvent<{ sticky: boolean; corner?: StickyCorner }>).detail;\n emit('sticky', detail.sticky, detail.corner);\n },\n ],\n ];\n for (const [name, handler] of listeners) el.addEventListener(name, handler);\n\n // .options için import'u bekle: element upgrade olmadan yazmak prototip accessor'ını kalıcı olarak maskeler.\n import('@hopeplayer/core').then(() => {\n if (cancelled || !elRef.value) return;\n elRef.value.options = { ...props } as HopePlayerOptions;\n });\n});\n\n// Tüm prop'lar tek bir string olarak izlenir (prop başına ayrı watcher gerekmez).\nwatch(\n () => JSON.stringify(props),\n () => {\n if (elRef.value) elRef.value.options = { ...props } as HopePlayerOptions;\n }\n);\n\nonBeforeUnmount(() => {\n cancelled = true;\n const el = elRef.value;\n if (el) for (const [name, handler] of listeners) el.removeEventListener(name, handler);\n});\n\nfunction play(): Promise<void> {\n return elRef.value?.play() ?? Promise.resolve();\n}\n\nfunction pause(): void {\n elRef.value?.pause();\n}\n\nfunction getElement(): HopePlayerEl | null {\n return elRef.value;\n}\n\ndefineExpose({ play, pause, getElement });\n</script>\n\n<template>\n <hope-player ref=\"elRef\" />\n</template>\n"],"names":["props","__props","emit","__emit","elRef","ref","cancelled","listeners","onMounted","el","detail","name","handler","watch","onBeforeUnmount","play","_a","pause","getElement","__expose","_createElementBlock"],"mappings":"
|
|
1
|
+
{"version":3,"file":"hope-player-vue.js","sources":["../src/HopePlayer.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// <hope-player> için ince Vue sarmalayıcı: prop'ları `.options`'a yazar, `hp:*` event'lerini emit'lere çevirir.\n// class/style Vue'nun fallthrough attribute'larıyla köke geçer. Core `onMounted` içinde dinamik import edilir —\n// statik import `HTMLElement` olmayan SSR'da (Nuxt) çöker.\nimport { ref, onMounted, onBeforeUnmount, watch } from 'vue';\nimport type { HopePlayerElement as HopePlayerEl, HopePlayerEventMap, HopePlayerOptions, StickyCorner } from '@hopeplayer/core';\n\nconst props = defineProps<HopePlayerOptions>();\n\nconst emit = defineEmits<{\n ready: [];\n play: [];\n pause: [];\n ended: [];\n error: [message: string];\n qualitychange: [label: string];\n ratechange: [rate: number];\n adstart: [type: 'preroll' | 'midroll' | 'postroll'];\n adend: [type: 'preroll' | 'midroll' | 'postroll'];\n aderror: [message: string];\n itemchange: [index: number, source: 'playlist' | 'story'];\n sticky: [sticky: boolean, corner: StickyCorner | undefined];\n sourcefallback: [detail: HopePlayerEventMap['hp:sourcefallback']['detail']];\n}>();\n\nconst elRef = ref<HopePlayerEl | null>(null);\nlet cancelled = false;\nlet listeners: Array<[keyof HopePlayerEventMap, EventListener]> = [];\n\nonMounted(() => {\n const el = elRef.value;\n if (!el) return;\n\n // Dinleyiciler import'u beklemeden eklenir: core yüklenince customElements.define() elementi senkron upgrade\n // edip hp:ready'yi .then()'den ÖNCE dispatch ediyor — beklenirse @ready kaçırılır.\n listeners = [\n ['hp:ready', () => emit('ready')],\n ['hp:play', () => emit('play')],\n ['hp:pause', () => emit('pause')],\n ['hp:ended', () => emit('ended')],\n ['hp:error', (e) => emit('error', (e as CustomEvent<{ message: string }>).detail.message)],\n ['hp:qualitychange', (e) => emit('qualitychange', (e as CustomEvent<{ label: string }>).detail.label)],\n ['hp:ratechange', (e) => emit('ratechange', (e as CustomEvent<{ rate: number }>).detail.rate)],\n ['hp:adstart', (e) => emit('adstart', (e as CustomEvent<{ type: 'preroll' | 'midroll' | 'postroll' }>).detail.type)],\n ['hp:adend', (e) => emit('adend', (e as CustomEvent<{ type: 'preroll' | 'midroll' | 'postroll' }>).detail.type)],\n ['hp:aderror', (e) => emit('aderror', (e as CustomEvent<{ message: string }>).detail.message)],\n [\n 'hp:itemchange',\n (e) => {\n const detail = (e as CustomEvent<{ index: number; source: 'playlist' | 'story' }>).detail;\n emit('itemchange', detail.index, detail.source);\n },\n ],\n [\n 'hp:sticky',\n (e) => {\n const detail = (e as CustomEvent<{ sticky: boolean; corner?: StickyCorner }>).detail;\n emit('sticky', detail.sticky, detail.corner);\n },\n ],\n ['hp:sourcefallback', (e) => emit('sourcefallback', (e as HopePlayerEventMap['hp:sourcefallback']).detail)],\n ];\n for (const [name, handler] of listeners) el.addEventListener(name, handler);\n\n // .options için import'u bekle: element upgrade olmadan yazmak prototip accessor'ını kalıcı olarak maskeler.\n import('@hopeplayer/core').then(() => {\n if (cancelled || !elRef.value) return;\n elRef.value.options = { ...props } as HopePlayerOptions;\n });\n});\n\n// Tüm prop'lar tek bir string olarak izlenir (prop başına ayrı watcher gerekmez).\nwatch(\n () => JSON.stringify(props),\n () => {\n if (elRef.value) elRef.value.options = { ...props } as HopePlayerOptions;\n }\n);\n\nonBeforeUnmount(() => {\n cancelled = true;\n const el = elRef.value;\n if (el) for (const [name, handler] of listeners) el.removeEventListener(name, handler);\n});\n\nfunction play(): Promise<void> {\n return elRef.value?.play() ?? Promise.resolve();\n}\n\nfunction pause(): void {\n elRef.value?.pause();\n}\n\nfunction getElement(): HopePlayerEl | null {\n return elRef.value;\n}\n\ndefineExpose({ play, pause, getElement });\n</script>\n\n<template>\n <hope-player ref=\"elRef\" />\n</template>\n"],"names":["props","__props","emit","__emit","elRef","ref","cancelled","listeners","onMounted","el","detail","name","handler","watch","onBeforeUnmount","play","_a","pause","getElement","__expose","_createElementBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,UAAMA,IAAQC,GAERC,IAAOC,GAgBPC,IAAQC,EAAyB,IAAI;AAC3C,QAAIC,IAAY,IACZC,IAA8D,CAAA;AAElE,IAAAC,EAAU,MAAM;AACZ,YAAMC,IAAKL,EAAM;AACjB,UAAKK,GAIL;AAAA,QAAAF,IAAY;AAAA,UACR,CAAC,YAAY,MAAML,EAAK,OAAO,CAAC;AAAA,UAChC,CAAC,WAAW,MAAMA,EAAK,MAAM,CAAC;AAAA,UAC9B,CAAC,YAAY,MAAMA,EAAK,OAAO,CAAC;AAAA,UAChC,CAAC,YAAY,MAAMA,EAAK,OAAO,CAAC;AAAA,UAChC,CAAC,YAAY,CAAC,MAAMA,EAAK,SAAU,EAAuC,OAAO,OAAO,CAAC;AAAA,UACzF,CAAC,oBAAoB,CAAC,MAAMA,EAAK,iBAAkB,EAAqC,OAAO,KAAK,CAAC;AAAA,UACrG,CAAC,iBAAiB,CAAC,MAAMA,EAAK,cAAe,EAAoC,OAAO,IAAI,CAAC;AAAA,UAC7F,CAAC,cAAc,CAAC,MAAMA,EAAK,WAAY,EAAgE,OAAO,IAAI,CAAC;AAAA,UACnH,CAAC,YAAY,CAAC,MAAMA,EAAK,SAAU,EAAgE,OAAO,IAAI,CAAC;AAAA,UAC/G,CAAC,cAAc,CAAC,MAAMA,EAAK,WAAY,EAAuC,OAAO,OAAO,CAAC;AAAA,UAC7F;AAAA,YACI;AAAA,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mBAIpCE,EAA2B,eAAA;AAAA,eAAV;AAAA,MAAJ,KAAIhB;AAAA,IAAA;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hopeplayer/vue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "Thin Vue 3 wrapper around <hope-player> (@hopeplayer/core) — prop/event bridge only, no state duplication",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"typecheck": "vue-tsc -p tsconfig.json --noEmit"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@hopeplayer/core": "^1.0.
|
|
37
|
+
"@hopeplayer/core": "^1.0.16",
|
|
38
38
|
"vue": ">=3.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@hopeplayer/core": "^1.0.
|
|
41
|
+
"@hopeplayer/core": "^1.0.16",
|
|
42
42
|
"@vitejs/plugin-vue": "^6.0.0",
|
|
43
43
|
"typescript": "^5.7.0",
|
|
44
44
|
"vite": "^6.0.0",
|