@latest-thinking/lt-player 2.0.0-o → 2.0.0-p

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.
Files changed (2) hide show
  1. package/dist/main.js +22 -1
  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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latest-thinking/lt-player",
3
- "version": "2.0.0-o",
3
+ "version": "2.0.0-p",
4
4
  "description": "Latest Thinking Player",
5
5
  "main": "dist/main.js",
6
6
  "module": "dist/main.js",