@octane-xplat/video 0.11.0 → 0.12.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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { applyEscapeProps } from "./escape-props.web.js";
|
|
2
2
|
import { layoutChildProps } from "./layout-child.web.js";
|
|
3
3
|
import { VideoChrome } from "./video-chrome.web.tsrx.js";
|
|
4
|
-
import { __s, bagOf, child, clone, componentSlotVoid, delegateEvents, evt1, evt1e, evt1u, evt2e, evt2u, hookSlots, ifBlock, markDangerouslySetInnerHTMLChildren, queueRefAttach, queueRefDetach,
|
|
5
|
-
import {
|
|
4
|
+
import { __s, bagOf, child, clone, componentSlotVoid, delegateEvents, evt1, evt1e, evt1u, evt2e, evt2u, hookSlots, ifBlock, markDangerouslySetInnerHTMLChildren, queueRefAttach, queueRefDetach, setEventHandler, setStyleProperty, sibling, snapshotSpread, template, useEffect, useImperativeHandle, useRef, useState } from "octane";
|
|
5
|
+
import { bindSignalHostPropSources, compilerMemoRegion, enableSignalBindings, hookMemoCreate, hookMemoPublishInvariant, replaceRef, setAttributeIfChanged, setBooleanAttributeIfChanged, setPlainAttributeIfChanged, setURLAttributeIfChanged } from "octane/internal/client";
|
|
6
6
|
//#region src/Video.web.tsrx
|
|
7
7
|
enableSignalBindings(1, true);
|
|
8
8
|
delegateEvents([
|
|
@@ -62,7 +62,7 @@ function __then$0(__props, __s, __extra) {
|
|
|
62
62
|
setPosition(ms);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
}, __block.endMarker,
|
|
65
|
+
}, "c:c3e56410", __block.endMarker, 2);
|
|
66
66
|
}
|
|
67
67
|
var _rm$3 = [
|
|
68
68
|
"s",
|
|
@@ -125,7 +125,7 @@ var Video = /* @__PURE__ */ __s(function Video(props, __s, __extra) {
|
|
|
125
125
|
if (__s.block.pending && !__s.block.crossRenderUpdate) return;
|
|
126
126
|
let _b = __s.slots[0];
|
|
127
127
|
if (_b === void 0) {
|
|
128
|
-
let _m0, _m1, _m2, _m3, _m4, _m5, _m6, _m7, _m8, _m9, _m10, _m11,
|
|
128
|
+
let _m0, _m1, _m2, _m3, _m4, _m5, _m6, _m7, _m8, _m9, _m10, _m11, _m13, _m15, _m21, _m22, _m23, _m24;
|
|
129
129
|
const _root = clone(_t$0);
|
|
130
130
|
_m0 = props.id;
|
|
131
131
|
_m1 = [
|
|
@@ -143,7 +143,6 @@ var Video = /* @__PURE__ */ __s(function Video(props, __s, __extra) {
|
|
|
143
143
|
_m9 = props.accessibilityState?.selected;
|
|
144
144
|
_m10 = props.accessibilityState?.checked;
|
|
145
145
|
_m11 = props.accessibilityLiveRegion === "none" ? "off" : props.accessibilityLiveRegion;
|
|
146
|
-
_m12 = _root;
|
|
147
146
|
_m13 = bindSignalHostPropSources(__s, void 0, _root, [
|
|
148
147
|
[
|
|
149
148
|
false,
|
|
@@ -208,7 +207,7 @@ var Video = /* @__PURE__ */ __s(function Video(props, __s, __extra) {
|
|
|
208
207
|
if (!v) return;
|
|
209
208
|
v.muted = muted;
|
|
210
209
|
applyEscapeProps(v, props);
|
|
211
|
-
},
|
|
210
|
+
}, _el0);
|
|
212
211
|
(__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.p, _b.o));
|
|
213
212
|
evt1(_el0, "$$play", setPlaying, true);
|
|
214
213
|
evt1(_el0, "$$pause", setPlaying, false);
|
|
@@ -232,9 +231,9 @@ var Video = /* @__PURE__ */ __s(function Video(props, __s, __extra) {
|
|
|
232
231
|
j: _m9,
|
|
233
232
|
k: _m10,
|
|
234
233
|
l: _m11,
|
|
235
|
-
m:
|
|
234
|
+
m: _root,
|
|
236
235
|
n: _m13,
|
|
237
|
-
o:
|
|
236
|
+
o: _el0,
|
|
238
237
|
p: _m15,
|
|
239
238
|
q: void 0,
|
|
240
239
|
r: void 0,
|
|
@@ -368,10 +367,10 @@ var Video = /* @__PURE__ */ __s(function Video(props, __s, __extra) {
|
|
|
368
367
|
evt2u(_b.w, __event$, props, setPlaying);
|
|
369
368
|
evt1u(_b.x, __event$2, props);
|
|
370
369
|
}
|
|
371
|
-
_b.q =
|
|
372
|
-
_b.r =
|
|
373
|
-
_b.s =
|
|
374
|
-
_b.t =
|
|
370
|
+
_b.q = setURLAttributeIfChanged(props.src, _b.q, _b.o, "src");
|
|
371
|
+
_b.r = setPlainAttributeIfChanged(props.poster, _b.r, _b.o, "poster");
|
|
372
|
+
_b.s = setAttributeIfChanged(muted, _b.s, _b.o, "muted");
|
|
373
|
+
_b.t = setBooleanAttributeIfChanged(props.loop, _b.t, _b.o, "loop");
|
|
375
374
|
{
|
|
376
375
|
const _v = props.fit ?? "contain";
|
|
377
376
|
if (_b.u !== _v) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { bag4, child, clone, componentSlot, drainFrag, hookSlots, ifBlock, markChildrenBlock, markWarm, registerWarmPlan, template, useEffect, useState, warmChild } from "octane";
|
|
2
|
-
import { textHoleUpdate } from "octane/internal/client";
|
|
2
|
+
import { ownSlotAnchor, textHoleUpdate } from "octane/internal/client";
|
|
3
3
|
import { HStack, Icon, Image, Pressable, Slider, Text, View } from "@octane-xplat/ui";
|
|
4
4
|
//#region src/video-chrome.web.tsrx
|
|
5
5
|
var _t$0 = /* @__PURE__ */ template("<!>", 0, 1);
|
|
@@ -12,7 +12,7 @@ function __then$0(__props, __s, __extra) {
|
|
|
12
12
|
"src": props.poster,
|
|
13
13
|
"ios": { stretch: "aspectFill" },
|
|
14
14
|
"android": { stretch: "aspectFill" }
|
|
15
|
-
}, __block.endMarker,
|
|
15
|
+
}, "c:afd81fd1", __block.endMarker, 2);
|
|
16
16
|
}
|
|
17
17
|
var __childrenBody = {};
|
|
18
18
|
var __childrenBody$ = {};
|
|
@@ -27,12 +27,12 @@ function __then$5(__props, __s, __extra) {
|
|
|
27
27
|
"name": "xplat-play",
|
|
28
28
|
"size": 28,
|
|
29
29
|
"color": "#fff"
|
|
30
|
-
}, __block.endMarker,
|
|
30
|
+
}, "c:8182c208", __block.endMarker, 2);
|
|
31
31
|
}
|
|
32
32
|
componentSlot(__s, 0, __block.parentNode, View, {
|
|
33
33
|
"className": "vx-video-centerbtn",
|
|
34
34
|
"children": markChildrenBlock(__children$9, __childrenBody)
|
|
35
|
-
},
|
|
35
|
+
}, "c:cb7b2c3f", __block.endMarker);
|
|
36
36
|
}
|
|
37
37
|
componentSlot(__s, 0, __block.parentNode, Pressable, {
|
|
38
38
|
"className": "vx-video-center",
|
|
@@ -42,7 +42,7 @@ function __then$5(__props, __s, __extra) {
|
|
|
42
42
|
"accessibilityLabel": "Play",
|
|
43
43
|
"onPress": props.onTogglePlay,
|
|
44
44
|
"children": markChildrenBlock(__children$7, __childrenBody$)
|
|
45
|
-
},
|
|
45
|
+
}, "c:4f97cdfe", __block.endMarker);
|
|
46
46
|
}
|
|
47
47
|
var __childrenBody$2 = {};
|
|
48
48
|
var __childrenBody$3 = {};
|
|
@@ -63,7 +63,7 @@ function __then$4(__props, __s, __extra) {
|
|
|
63
63
|
"name": props.playing ? "xplat-pause" : "xplat-play",
|
|
64
64
|
"size": 20,
|
|
65
65
|
"color": "#fff"
|
|
66
|
-
}, __block.endMarker,
|
|
66
|
+
}, "c:a4e0e905", __block.endMarker, 2);
|
|
67
67
|
}
|
|
68
68
|
function __children$20(__props, __s, __extra) {
|
|
69
69
|
const __block = __s.block;
|
|
@@ -74,7 +74,7 @@ function __then$4(__props, __s, __extra) {
|
|
|
74
74
|
_m0 = __block.parentNode;
|
|
75
75
|
_m1 = child(_root);
|
|
76
76
|
drainFrag(_root, __block.parentNode, __block.endMarker);
|
|
77
|
-
_b = bag4(__s, null, _m0, _m1, null,
|
|
77
|
+
_b = bag4(__s, null, _m0, _m1, null, __s);
|
|
78
78
|
}
|
|
79
79
|
{
|
|
80
80
|
const _v = stamp(props.position);
|
|
@@ -91,7 +91,7 @@ function __then$4(__props, __s, __extra) {
|
|
|
91
91
|
_m0 = __block.parentNode;
|
|
92
92
|
_m1 = child(_root);
|
|
93
93
|
drainFrag(_root, __block.parentNode, __block.endMarker);
|
|
94
|
-
_b = bag4(__s, null, _m0, _m1, null,
|
|
94
|
+
_b = bag4(__s, null, _m0, _m1, null, __s);
|
|
95
95
|
}
|
|
96
96
|
{
|
|
97
97
|
const _v = stamp(props.duration);
|
|
@@ -105,7 +105,7 @@ function __then$4(__props, __s, __extra) {
|
|
|
105
105
|
"name": props.muted ? "xplat-volume-off" : "xplat-volume",
|
|
106
106
|
"size": 20,
|
|
107
107
|
"color": "#fff"
|
|
108
|
-
}, __block.endMarker,
|
|
108
|
+
}, "c:78a524c0", __block.endMarker, 2);
|
|
109
109
|
}
|
|
110
110
|
componentSlot(__s, 0, __block.parentNode, Pressable, {
|
|
111
111
|
"className": "vx-video-btn",
|
|
@@ -113,11 +113,11 @@ function __then$4(__props, __s, __extra) {
|
|
|
113
113
|
"accessibilityLabel": props.playing ? "Pause" : "Play",
|
|
114
114
|
"onPress": props.onTogglePlay,
|
|
115
115
|
"children": markChildrenBlock(__children$17, __childrenBody$2)
|
|
116
|
-
},
|
|
116
|
+
}, "c:cf122bea", __block.endMarker);
|
|
117
117
|
componentSlot(__s, 1, __block.parentNode, Text, {
|
|
118
118
|
"className": "vx-video-time",
|
|
119
119
|
"children": markChildrenBlock(__children$20, __childrenBody$3)
|
|
120
|
-
},
|
|
120
|
+
}, "c:63f67e7a", __block.endMarker);
|
|
121
121
|
componentSlot(__s, 2, __block.parentNode, Slider, {
|
|
122
122
|
"className": "vx-video-slider",
|
|
123
123
|
"style": { flexGrow: 1 },
|
|
@@ -125,32 +125,32 @@ function __then$4(__props, __s, __extra) {
|
|
|
125
125
|
"minValue": 0,
|
|
126
126
|
"maxValue": props.duration > 0 ? props.duration : 1,
|
|
127
127
|
"onValueChange": props.onSeek
|
|
128
|
-
}, __block.endMarker,
|
|
128
|
+
}, "c:2b300510", __block.endMarker, 2);
|
|
129
129
|
componentSlot(__s, 3, __block.parentNode, Text, {
|
|
130
130
|
"className": "vx-video-time",
|
|
131
131
|
"children": markChildrenBlock(__children$24, __childrenBody$4)
|
|
132
|
-
},
|
|
132
|
+
}, "c:37a813f4", __block.endMarker);
|
|
133
133
|
componentSlot(__s, 4, __block.parentNode, Pressable, {
|
|
134
134
|
"className": "vx-video-btn",
|
|
135
135
|
"accessibilityRole": "button",
|
|
136
136
|
"accessibilityLabel": props.muted ? "Unmute" : "Mute",
|
|
137
137
|
"onPress": props.onToggleMute,
|
|
138
138
|
"children": markChildrenBlock(__children$27, __childrenBody$5)
|
|
139
|
-
},
|
|
139
|
+
}, "c:9bf9319c", __block.endMarker);
|
|
140
140
|
}
|
|
141
141
|
componentSlot(__s, 0, __block.parentNode, HStack, {
|
|
142
142
|
"className": "vx-video-bar",
|
|
143
143
|
"vAlign": "center",
|
|
144
144
|
"gap": 2,
|
|
145
145
|
"children": markChildrenBlock(__children$15, __childrenBody$6)
|
|
146
|
-
},
|
|
146
|
+
}, "c:455e7102", __block.endMarker);
|
|
147
147
|
}
|
|
148
|
-
ifBlock(__s, 0, __block.parentNode, !props.playing, __then$5, null, __block
|
|
148
|
+
ifBlock(__s, 0, __block.parentNode, !props.playing, __then$5, null, ownSlotAnchor(__s, 0, __block), __extra);
|
|
149
149
|
componentSlot(__s, 1, __block.parentNode, View, {
|
|
150
150
|
"className": "vx-video-barwrap",
|
|
151
151
|
"justifyContent": "end",
|
|
152
152
|
"children": markChildrenBlock(__children$13, __childrenBody$7)
|
|
153
|
-
},
|
|
153
|
+
}, "c:4aa1741f", __block.endMarker);
|
|
154
154
|
}
|
|
155
155
|
function stamp(ms) {
|
|
156
156
|
const total = Math.max(0, Math.floor(ms / 1e3));
|
|
@@ -176,14 +176,14 @@ var VideoChrome = /* @__PURE__ */ markWarm(function VideoChrome(props, __s, __ex
|
|
|
176
176
|
}, void 0);
|
|
177
177
|
{
|
|
178
178
|
const __ifCondition = props.poster && !props.started;
|
|
179
|
-
ifBlock(__s, 0, __block.parentNode, __ifCondition, __then$0, null, __block
|
|
179
|
+
ifBlock(__s, 0, __block.parentNode, __ifCondition, __then$0, null, ownSlotAnchor(__s, 0, __block), __ifCondition ? [props] : void 0);
|
|
180
180
|
}
|
|
181
181
|
componentSlot(__s, 1, __block.parentNode, Pressable, {
|
|
182
182
|
"className": "vx-video-tap",
|
|
183
183
|
"accessibilityRole": "button",
|
|
184
184
|
"accessibilityLabel": visible ? "Hide video controls" : "Show video controls",
|
|
185
185
|
"onPress": () => setVisible(props.playing ? !visible : true)
|
|
186
|
-
}, __block.endMarker,
|
|
186
|
+
}, "c:45f0b642", __block.endMarker, 2);
|
|
187
187
|
{
|
|
188
188
|
const __ifCondition$ = visible;
|
|
189
189
|
ifBlock(__s, 2, __block.parentNode, __ifCondition$, __then$4, null, __block.endMarker, __ifCondition$ ? [props] : void 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octane-xplat/video",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Embedded video player for Octane xplat — web <video> + @nstudio/nativescript-exoplayer (ExoPlayer / AVPlayerViewController) with self-drawn chrome",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"android",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@nativescript-community/octane": "0.2.4",
|
|
52
|
-
"@nativescript/core": "9.1.
|
|
53
|
-
"@octane-xplat/ui": "0.
|
|
52
|
+
"@nativescript/core": "9.1.3",
|
|
53
|
+
"@octane-xplat/ui": "0.12.0",
|
|
54
54
|
"@octanejs/vite-plugin": "0.1.61",
|
|
55
|
-
"octane": "0.
|
|
55
|
+
"octane": "0.10.2",
|
|
56
56
|
"tsrx-typegen": "0.2.2",
|
|
57
57
|
"typescript": "5.9.3",
|
|
58
58
|
"vite": "8.3.0"
|