@latest-thinking/lt-player 2.0.0-o → 2.0.0-q
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/main.js +23 -2
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -18953,7 +18953,7 @@ class dy {
|
|
|
18953
18953
|
update() {
|
|
18954
18954
|
Vt.info("Starting player configuration update"), this.player.playerRenderService.replaceLayout(), this.player.playerShareService.update(), this.player.playerSpeedService.update(), this.player.playerChapterService.update(), this.player.playerMetadataService.update(), this.player.playerFeedbackService.update(), this.player.playerPosterService.update();
|
|
18955
18955
|
let e = this.player.playerConfigService.getDuration();
|
|
18956
|
-
e ? this.setChapters(this.player.playerChapterService.getChapterTrack(e)) : this.clearChapters(), this.player.vidstackPlayer.dataset.ltOrientation = this.player.playerConfigService.getPlayerOrientation(), this.player.vidstackPlayer.setAttribute("fullscreen-orientation", this.player.playerConfigService.getPlayerOrientation()), this.setSource(this.player.playerConfigService.getSourceUrl(0)), this.setPoster(
|
|
18956
|
+
e ? this.setChapters(this.player.playerChapterService.getChapterTrack(e)) : this.clearChapters(), this.player.vidstackPlayer.dataset.ltOrientation = this.player.playerConfigService.getPlayerOrientation(), this.player.vidstackPlayer.setAttribute("fullscreen-orientation", this.player.playerConfigService.getPlayerOrientation()), this.setCrossOrigin(this.getCrossOriginMode()), this.setSource(this.player.playerConfigService.getSourceUrl(0)), this.setPoster(
|
|
18957
18957
|
this.player.playerConfigService.getPoster(),
|
|
18958
18958
|
this.player.playerConfigService.getTitle(),
|
|
18959
18959
|
this.player.playerConfigService.getAuthor()
|
|
@@ -18967,6 +18967,13 @@ class dy {
|
|
|
18967
18967
|
let a = i.querySelector(".metadata-title");
|
|
18968
18968
|
a && (a.textContent = A);
|
|
18969
18969
|
}
|
|
18970
|
+
setCrossOrigin(e) {
|
|
18971
|
+
if (e === null) {
|
|
18972
|
+
this.player.vidstackPlayer.removeAttribute("crossorigin");
|
|
18973
|
+
return;
|
|
18974
|
+
}
|
|
18975
|
+
this.player.vidstackPlayer.setAttribute("crossorigin", e);
|
|
18976
|
+
}
|
|
18970
18977
|
setSource(e) {
|
|
18971
18978
|
this.player.vidstackPlayer.src == e ? (this.player.vidstackPlayer.src = "", setTimeout(() => {
|
|
18972
18979
|
this.player.vidstackPlayer.src = e;
|
|
@@ -18995,6 +19002,20 @@ class dy {
|
|
|
18995
19002
|
for (const s of A)
|
|
18996
19003
|
this.player.vidstackPlayer.textTracks.remove(s);
|
|
18997
19004
|
}
|
|
19005
|
+
getCrossOriginMode() {
|
|
19006
|
+
const e = this.player.getAttribute("crossorigin");
|
|
19007
|
+
if (e !== null)
|
|
19008
|
+
return e === "" ? "anonymous" : e;
|
|
19009
|
+
const A = this.player.playerConfigService.getSourceUrl(0);
|
|
19010
|
+
return this.isCrossOriginSource(A) ? "anonymous" : null;
|
|
19011
|
+
}
|
|
19012
|
+
isCrossOriginSource(e) {
|
|
19013
|
+
try {
|
|
19014
|
+
return new URL(e, window.location.href).origin !== window.location.origin;
|
|
19015
|
+
} catch {
|
|
19016
|
+
return !1;
|
|
19017
|
+
}
|
|
19018
|
+
}
|
|
18998
19019
|
}
|
|
18999
19020
|
class uy {
|
|
19000
19021
|
constructor(e) {
|
|
@@ -19465,7 +19486,7 @@ const Sd = class Sd extends HTMLElement {
|
|
|
19465
19486
|
throw new yh("Cannot find dialog element");
|
|
19466
19487
|
this.dialogElement = e;
|
|
19467
19488
|
const A = (i = this.dialogElement) == null ? void 0 : i.querySelector("input.lt-share-input");
|
|
19468
|
-
A && (this.shareInput = A, this.shareInput.
|
|
19489
|
+
A && (this.shareInput = A, this.shareInput.readOnly = !0), this.updateShowModal();
|
|
19469
19490
|
let s = this.dialogElement.querySelector(".close-modal-js");
|
|
19470
19491
|
s == null || s.addEventListener("click", () => {
|
|
19471
19492
|
this.closeEvent();
|