shaka-video-element 0.6.17 → 0.6.19
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/cjs/react.js +14 -2
- package/dist/react.d.ts +1 -1
- package/dist/react.js +14 -2
- package/dist/shaka-video-element.js +14942 -13233
- package/package.json +3 -3
package/dist/cjs/react.js
CHANGED
|
@@ -65,6 +65,7 @@ function createComponent({
|
|
|
65
65
|
elementClass,
|
|
66
66
|
events,
|
|
67
67
|
displayName,
|
|
68
|
+
defaultProps,
|
|
68
69
|
toAttributeName = defaultToAttributeName,
|
|
69
70
|
toAttributeValue = defaultToAttributeValue
|
|
70
71
|
}) {
|
|
@@ -99,7 +100,12 @@ function createComponent({
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
if (attrName && IS_REACT_19_OR_NEWER) {
|
|
102
|
-
|
|
103
|
+
const attrValueFromDefault = defaultToAttributeValue(v);
|
|
104
|
+
if (attrValue !== attrValueFromDefault) {
|
|
105
|
+
reactProps[attrName] = attrValue;
|
|
106
|
+
} else {
|
|
107
|
+
reactProps[attrName] = v;
|
|
108
|
+
}
|
|
103
109
|
}
|
|
104
110
|
}
|
|
105
111
|
if (typeof window !== "undefined") {
|
|
@@ -145,6 +151,7 @@ function createComponent({
|
|
|
145
151
|
reactProps.children = [templateShadowRoot, reactProps.children];
|
|
146
152
|
}
|
|
147
153
|
return React2.createElement(tagName, {
|
|
154
|
+
...defaultProps,
|
|
148
155
|
...reactProps,
|
|
149
156
|
ref: React2.useCallback(
|
|
150
157
|
(node) => {
|
|
@@ -174,7 +181,12 @@ function setProperty(node, name, value) {
|
|
|
174
181
|
var react_default = createComponent({
|
|
175
182
|
react: import_react.default,
|
|
176
183
|
tagName: "shaka-video",
|
|
177
|
-
elementClass: import_shaka_video_element.default
|
|
184
|
+
elementClass: import_shaka_video_element.default,
|
|
185
|
+
toAttributeName(propName) {
|
|
186
|
+
if (propName === "muted") return "";
|
|
187
|
+
if (propName === "defaultMuted") return "muted";
|
|
188
|
+
return defaultToAttributeName(propName);
|
|
189
|
+
}
|
|
178
190
|
});
|
|
179
191
|
/*! Bundled license information:
|
|
180
192
|
|
package/dist/react.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import CustomMediaElement from './shaka-video-element.js';
|
|
3
3
|
|
|
4
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<CustomMediaElement>, "disablePictureInPicture" | "height" | "onenterpictureinpicture" | "onleavepictureinpicture" | "playsInline" | "poster" | "videoHeight" | "videoWidth" | "width" | "cancelVideoFrameCallback" | "getVideoPlaybackQuality" | "requestPictureInPicture" | "requestVideoFrameCallback" | "autoplay" | "buffered" | "controls" | "crossOrigin" | "currentSrc" | "currentTime" | "
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<CustomMediaElement>, "muted" | "defaultMuted" | "disablePictureInPicture" | "height" | "onenterpictureinpicture" | "onleavepictureinpicture" | "playsInline" | "poster" | "videoHeight" | "videoWidth" | "width" | "cancelVideoFrameCallback" | "getVideoPlaybackQuality" | "requestPictureInPicture" | "requestVideoFrameCallback" | "autoplay" | "buffered" | "controls" | "crossOrigin" | "currentSrc" | "currentTime" | "defaultPlaybackRate" | "disableRemotePlayback" | "duration" | "ended" | "error" | "loop" | "mediaKeys" | "networkState" | "onencrypted" | "onwaitingforkey" | "paused" | "playbackRate" | "played" | "preload" | "preservesPitch" | "readyState" | "remote" | "seekable" | "seeking" | "sinkId" | "src" | "srcObject" | "textTracks" | "volume" | "addTextTrack" | "canPlayType" | "fastSeek" | "load" | "pause" | "play" | "setMediaKeys" | "setSinkId" | "NETWORK_EMPTY" | "NETWORK_IDLE" | "NETWORK_LOADING" | "NETWORK_NO_SOURCE" | "HAVE_NOTHING" | "HAVE_METADATA" | "HAVE_CURRENT_DATA" | "HAVE_FUTURE_DATA" | "HAVE_ENOUGH_DATA"> & {} & Partial<Omit<CustomMediaElement, keyof HTMLElement | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "adoptedCallback">> & React.RefAttributes<CustomMediaElement>>;
|
|
5
5
|
|
|
6
6
|
export { _default as default };
|
package/dist/react.js
CHANGED
|
@@ -33,6 +33,7 @@ function createComponent({
|
|
|
33
33
|
elementClass,
|
|
34
34
|
events,
|
|
35
35
|
displayName,
|
|
36
|
+
defaultProps,
|
|
36
37
|
toAttributeName = defaultToAttributeName,
|
|
37
38
|
toAttributeValue = defaultToAttributeValue
|
|
38
39
|
}) {
|
|
@@ -67,7 +68,12 @@ function createComponent({
|
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
if (attrName && IS_REACT_19_OR_NEWER) {
|
|
70
|
-
|
|
71
|
+
const attrValueFromDefault = defaultToAttributeValue(v);
|
|
72
|
+
if (attrValue !== attrValueFromDefault) {
|
|
73
|
+
reactProps[attrName] = attrValue;
|
|
74
|
+
} else {
|
|
75
|
+
reactProps[attrName] = v;
|
|
76
|
+
}
|
|
71
77
|
}
|
|
72
78
|
}
|
|
73
79
|
if (typeof window !== "undefined") {
|
|
@@ -113,6 +119,7 @@ function createComponent({
|
|
|
113
119
|
reactProps.children = [templateShadowRoot, reactProps.children];
|
|
114
120
|
}
|
|
115
121
|
return React2.createElement(tagName, {
|
|
122
|
+
...defaultProps,
|
|
116
123
|
...reactProps,
|
|
117
124
|
ref: React2.useCallback(
|
|
118
125
|
(node) => {
|
|
@@ -142,7 +149,12 @@ function setProperty(node, name, value) {
|
|
|
142
149
|
var react_default = createComponent({
|
|
143
150
|
react: React,
|
|
144
151
|
tagName: "shaka-video",
|
|
145
|
-
elementClass: CustomMediaElement
|
|
152
|
+
elementClass: CustomMediaElement,
|
|
153
|
+
toAttributeName(propName) {
|
|
154
|
+
if (propName === "muted") return "";
|
|
155
|
+
if (propName === "defaultMuted") return "muted";
|
|
156
|
+
return defaultToAttributeName(propName);
|
|
157
|
+
}
|
|
146
158
|
});
|
|
147
159
|
export {
|
|
148
160
|
react_default as default
|