shaka-video-element 0.6.8 → 0.6.9
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/shaka-video-element.js +34 -6
- package/package.json +2 -2
|
@@ -25909,7 +25909,12 @@ function CustomMediaMixin(superclass, { tag, is }) {
|
|
|
25909
25909
|
if (typeof nativeElTest[prop] === "function") {
|
|
25910
25910
|
this.prototype[prop] = function(...args) {
|
|
25911
25911
|
this.#init();
|
|
25912
|
-
|
|
25912
|
+
const fn = () => {
|
|
25913
|
+
if (this.call) return this.call(prop, ...args);
|
|
25914
|
+
const nativeFn = this.nativeEl?.[prop];
|
|
25915
|
+
return nativeFn?.apply(this.nativeEl, args);
|
|
25916
|
+
};
|
|
25917
|
+
return fn();
|
|
25913
25918
|
};
|
|
25914
25919
|
} else {
|
|
25915
25920
|
const config = {
|
|
@@ -25920,7 +25925,7 @@ function CustomMediaMixin(superclass, { tag, is }) {
|
|
|
25920
25925
|
const val = this.getAttribute(attr);
|
|
25921
25926
|
return val === null ? false : val === "" ? true : val;
|
|
25922
25927
|
}
|
|
25923
|
-
return this.nativeEl?.[prop];
|
|
25928
|
+
return this.get?.(prop) ?? this.nativeEl?.[prop];
|
|
25924
25929
|
}
|
|
25925
25930
|
};
|
|
25926
25931
|
if (prop !== prop.toUpperCase()) {
|
|
@@ -25935,6 +25940,10 @@ function CustomMediaMixin(superclass, { tag, is }) {
|
|
|
25935
25940
|
}
|
|
25936
25941
|
return;
|
|
25937
25942
|
}
|
|
25943
|
+
if (this.set) {
|
|
25944
|
+
this.set(prop, val);
|
|
25945
|
+
return;
|
|
25946
|
+
}
|
|
25938
25947
|
if (this.nativeEl) {
|
|
25939
25948
|
this.nativeEl[prop] = val;
|
|
25940
25949
|
}
|
|
@@ -25949,6 +25958,9 @@ function CustomMediaMixin(superclass, { tag, is }) {
|
|
|
25949
25958
|
#nativeEl = null;
|
|
25950
25959
|
#childMap = /* @__PURE__ */ new Map();
|
|
25951
25960
|
#childObserver;
|
|
25961
|
+
get;
|
|
25962
|
+
set;
|
|
25963
|
+
call;
|
|
25952
25964
|
// If the custom element is defined before the custom element's HTML is parsed
|
|
25953
25965
|
// no attributes will be available in the constructor (construction process).
|
|
25954
25966
|
// Wait until initializing in the attributeChangedCallback or
|
|
@@ -25973,7 +25985,7 @@ function CustomMediaMixin(superclass, { tag, is }) {
|
|
|
25973
25985
|
this.setAttribute("src", `${val}`);
|
|
25974
25986
|
}
|
|
25975
25987
|
get preload() {
|
|
25976
|
-
return this.getAttribute("preload") ?? this.nativeEl?.
|
|
25988
|
+
return this.getAttribute("preload") ?? this.nativeEl?.preload;
|
|
25977
25989
|
}
|
|
25978
25990
|
set preload(val) {
|
|
25979
25991
|
this.setAttribute("preload", `${val}`);
|
|
@@ -25992,11 +26004,14 @@ function CustomMediaMixin(superclass, { tag, is }) {
|
|
|
25992
26004
|
this.shadowRoot.innerHTML = this.constructor.getTemplateHTML(attrs);
|
|
25993
26005
|
}
|
|
25994
26006
|
this.nativeEl.muted = this.hasAttribute("muted");
|
|
26007
|
+
for (const prop of nativeElProps) {
|
|
26008
|
+
this.#upgradeProperty(prop);
|
|
26009
|
+
}
|
|
25995
26010
|
this.#childObserver = new MutationObserver(this.#syncMediaChildAttribute.bind(this));
|
|
25996
26011
|
this.shadowRoot.addEventListener("slotchange", this);
|
|
25997
26012
|
this.#syncMediaChildren();
|
|
25998
26013
|
for (const type of this.constructor.Events) {
|
|
25999
|
-
this.shadowRoot?.addEventListener(type, this
|
|
26014
|
+
this.shadowRoot?.addEventListener(type, this, true);
|
|
26000
26015
|
}
|
|
26001
26016
|
}
|
|
26002
26017
|
handleEvent(event) {
|
|
@@ -26045,6 +26060,13 @@ function CustomMediaMixin(superclass, { tag, is }) {
|
|
|
26045
26060
|
trackEl.track.mode = "hidden";
|
|
26046
26061
|
}
|
|
26047
26062
|
}
|
|
26063
|
+
#upgradeProperty(prop) {
|
|
26064
|
+
if (Object.prototype.hasOwnProperty.call(this, prop)) {
|
|
26065
|
+
const value = this[prop];
|
|
26066
|
+
delete this[prop];
|
|
26067
|
+
this[prop] = value;
|
|
26068
|
+
}
|
|
26069
|
+
}
|
|
26048
26070
|
attributeChangedCallback(attrName, oldValue, newValue) {
|
|
26049
26071
|
this.#init();
|
|
26050
26072
|
this.#forwardAttribute(attrName, oldValue, newValue);
|
|
@@ -26074,11 +26096,17 @@ function getNativeElProps(nativeElTest) {
|
|
|
26074
26096
|
return nativeElProps;
|
|
26075
26097
|
}
|
|
26076
26098
|
function serializeAttributes(attrs) {
|
|
26077
|
-
|
|
26099
|
+
let html = "";
|
|
26100
|
+
for (const key in attrs) {
|
|
26101
|
+
const value = attrs[key];
|
|
26102
|
+
if (value === "") html += ` ${key}`;
|
|
26103
|
+
else html += ` ${key}="${value}"`;
|
|
26104
|
+
}
|
|
26105
|
+
return html;
|
|
26078
26106
|
}
|
|
26079
26107
|
function namedNodeMapToObject(namedNodeMap) {
|
|
26080
26108
|
const obj = {};
|
|
26081
|
-
for (const attr of
|
|
26109
|
+
for (const attr of namedNodeMap) {
|
|
26082
26110
|
obj[attr.name] = attr.value;
|
|
26083
26111
|
}
|
|
26084
26112
|
return obj;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shaka-video-element",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9",
|
|
4
4
|
"description": "Custom element (web component) for Shaka Player",
|
|
5
5
|
"author": "@muxinc",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"build": "run-s build:*"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"custom-media-element": "^1.4.
|
|
33
|
+
"custom-media-element": "^1.4.1",
|
|
34
34
|
"shaka-player": "~4.8.4"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|