vidply 1.0.0 → 1.0.1

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/vidply.css CHANGED
@@ -1668,6 +1668,59 @@
1668
1668
  background: var(--vidply-border-hover);
1669
1669
  }
1670
1670
 
1671
+ /* Sign Language Video */
1672
+ .vidply-sign-language-video {
1673
+ background: var(--vidply-black);
1674
+ border: 2px solid var(--vidply-white-30);
1675
+ border-radius: 4px;
1676
+ box-shadow: 0 4px 12px var(--vidply-black-60);
1677
+ height: auto !important;
1678
+ max-width: 400px;
1679
+ min-width: 150px;
1680
+ position: absolute;
1681
+ transition: opacity 0.3s ease;
1682
+ width: 35% !important;
1683
+ z-index: 100;
1684
+ }
1685
+
1686
+ .vidply-fullscreen .vidply-sign-language-video {
1687
+ max-width: 600px;
1688
+ }
1689
+
1690
+ /* Sign Language Video Positions */
1691
+ .vidply-sign-position-bottom-right {
1692
+ bottom: 80px; /* Above controls */
1693
+ right: 16px;
1694
+ }
1695
+
1696
+ .vidply-sign-position-bottom-left {
1697
+ bottom: 80px; /* Above controls */
1698
+ left: 16px;
1699
+ }
1700
+
1701
+ .vidply-sign-position-top-right {
1702
+ right: 16px;
1703
+ top: 16px;
1704
+ }
1705
+
1706
+ .vidply-sign-position-top-left {
1707
+ left: 16px;
1708
+ top: 16px;
1709
+ }
1710
+
1711
+ /* Responsive Sign Language Video */
1712
+ @media (width <= 640px) {
1713
+ .vidply-sign-language-video {
1714
+ min-width: 120px;
1715
+ width: 30%;
1716
+ }
1717
+
1718
+ .vidply-sign-position-bottom-right,
1719
+ .vidply-sign-position-bottom-left {
1720
+ bottom: 70px; /* Adjust for smaller controls */
1721
+ }
1722
+ }
1723
+
1671
1724
  /* Responsive Adjustments */
1672
1725
  @media (width <= 640px) {
1673
1726
  .vidply-playlist-thumbnail {
@@ -502,8 +502,8 @@ var iconPaths = {
502
502
  transcript: `<path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"/>`,
503
503
  audioDescription: `<path d="M12 3v9.28c-.47-.17-.97-.28-1.5-.28C8.01 12 6 14.01 6 16.5S8.01 21 10.5 21c2.31 0 4.2-1.75 4.45-4H15V6h4V3h-7z"/><path d="M10.5 19c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/>`,
504
504
  audioDescriptionOn: `<path d="M12 3v9.28c-.47-.17-.97-.28-1.5-.28C8.01 12 6 14.01 6 16.5S8.01 21 10.5 21c2.31 0 4.2-1.75 4.45-4H15V6h4V3h-7z"/><path d="M10.5 19c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/><circle cx="19" cy="16" r="3" fill="#3b82f6"/><path d="M18.5 17.5l1-1 1.5 1.5" stroke="white" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`,
505
- signLanguage: `<path d="M12 2C10.34 2 9 3.34 9 5v4c0 .34.07.66.18.96L7.5 8.29C7.19 8.1 6.85 8 6.5 8 5.12 8 4 9.12 4 10.5v3c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5v-3c0-.28.22-.5.5-.5s.5.22.5.5V14l2 2v-1c0-.55.45-1 1-1s1 .45 1 1v2c0 .55.45 1 1 1s1-.45 1-1V9c0-.55.45-1 1-1s1 .45 1 1v8c0 2.21-1.79 4-4 4s-4-1.79-4-4v-2.83l-2.93-2.93A3.93 3.93 0 0 1 4 8c0-1.66 1.34-3 3-3 .83 0 1.58.34 2.12.88L11 7.76V5c0-.55.45-1 1-1s1 .45 1 1v4c0 .55.45 1 1 1s1-.45 1-1V5c0-1.66-1.34-3-3-3z"/>`,
506
- signLanguageOn: `<path d="M12 2C10.34 2 9 3.34 9 5v4c0 .34.07.66.18.96L7.5 8.29C7.19 8.1 6.85 8 6.5 8 5.12 8 4 9.12 4 10.5v3c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5v-3c0-.28.22-.5.5-.5s.5.22.5.5V14l2 2v-1c0-.55.45-1 1-1s1 .45 1 1v2c0 .55.45 1 1 1s1-.45 1-1V9c0-.55.45-1 1-1s1 .45 1 1v8c0 2.21-1.79 4-4 4s-4-1.79-4-4v-2.83l-2.93-2.93A3.93 3.93 0 0 1 4 8c0-1.66 1.34-3 3-3 .83 0 1.58.34 2.12.88L11 7.76V5c0-.55.45-1 1-1s1 .45 1 1v4c0 .55.45 1 1 1s1-.45 1-1V5c0-1.66-1.34-3-3-3z"/><circle cx="19" cy="16" r="3" fill="#3b82f6"/><path d="M18.5 17.5l1-1 1.5 1.5" stroke="white" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`,
505
+ signLanguage: `<g transform="scale(1.5)"><path d="M16 11.3c-.1-.9-4.8 1.3-5.4 1.1-2.6-1 5.8-1.3 5.1-2.9s-5.1 1.5-6 1.4C6.5 9.4 16.5 9.1 13.5 8c-1.9-.6-8.8 2.9-6.8.4.7-.6.7-1.9-.7-1.7-9.7 7.2-.7 12.2 8.8 7 0-1.3-3.5.4-4.1.4-2.6 0 5.6-2 5.4-3ZM3.9 7.8c3.2-4.2 3.7 1.2 6 .1s.2-.2.2-.3c.7-2.7 2.5-7.5-1.5-1.3-1.6 0 1.1-4 1-4.6C8.9-1 7.3 4.4 7.2 4.9c-1.6.7-.9-1.4-.7-1.5 3-6-.6-3.1-.9.4-2.5 1.8 0-2.8 0-3.5C2.8-.9 4 9.4 1.1 4.9S.1 4.6 0 5c-.4 2.7 2.6 7.2 3.9 2.8Z"/></g>`,
506
+ signLanguageOn: `<g transform="scale(1.5)"><path d="M16 11.3c-.1-.9-4.8 1.3-5.4 1.1-2.6-1 5.8-1.3 5.1-2.9s-5.1 1.5-6 1.4C6.5 9.4 16.5 9.1 13.5 8c-1.9-.6-8.8 2.9-6.8.4.7-.6.7-1.9-.7-1.7-9.7 7.2-.7 12.2 8.8 7 0-1.3-3.5.4-4.1.4-2.6 0 5.6-2 5.4-3ZM3.9 7.8c3.2-4.2 3.7 1.2 6 .1s.2-.2.2-.3c.7-2.7 2.5-7.5-1.5-1.3-1.6 0 1.1-4 1-4.6C8.9-1 7.3 4.4 7.2 4.9c-1.6.7-.9-1.4-.7-1.5 3-6-.6-3.1-.9.4-2.5 1.8 0-2.8 0-3.5C2.8-.9 4 9.4 1.1 4.9S.1 4.6 0 5c-.4 2.7 2.6 7.2 3.9 2.8Z"/></g><circle cx="19" cy="19" r="3" fill="#3b82f6"/><path d="M17.5 19l1 1 2-2" stroke="white" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`,
507
507
  speaker: `<path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"/>`,
508
508
  music: `<path d="M12 3v9.28c-.47-.17-.97-.28-1.5-.28C8.01 12 6 14.01 6 16.5S8.01 21 10.5 21c2.31 0 4.2-1.75 4.45-4H15V6h4V3h-7zm-1.5 16c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/>`,
509
509
  moreVertical: `<path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>`,
@@ -5004,7 +5004,7 @@ var Player = class extends EventEmitter {
5004
5004
  this.signLanguageVideo = document.createElement("video");
5005
5005
  this.signLanguageVideo.className = "vidply-sign-language-video";
5006
5006
  this.signLanguageVideo.src = this.signLanguageSrc;
5007
- this.signLanguageVideo.setAttribute("aria-label", this.i18n.t("signLanguageVideo"));
5007
+ this.signLanguageVideo.setAttribute("aria-label", i18n.t("player.signLanguage"));
5008
5008
  const position = this.options.signLanguagePosition || "bottom-right";
5009
5009
  this.signLanguageVideo.classList.add(`vidply-sign-position-${position}`);
5010
5010
  this.signLanguageVideo.muted = true;
@@ -5541,9 +5541,56 @@ function initializePlayers() {
5541
5541
  const elements = document.querySelectorAll("[data-vidply]");
5542
5542
  elements.forEach((element) => {
5543
5543
  const options = element.dataset.vidplyOptions ? JSON.parse(element.dataset.vidplyOptions) : {};
5544
- new Player(element, options);
5544
+ const dataOptions = parseDataAttributes(element.dataset);
5545
+ const mergedOptions = { ...dataOptions, ...options };
5546
+ new Player(element, mergedOptions);
5545
5547
  });
5546
5548
  }
5549
+ function parseDataAttributes(dataset) {
5550
+ const options = {};
5551
+ const attributeMap = {
5552
+ // Sign Language
5553
+ "signLanguageSrc": "signLanguageSrc",
5554
+ "signLanguageButton": "signLanguageButton",
5555
+ "signLanguagePosition": "signLanguagePosition",
5556
+ // Audio Description
5557
+ "audioDescriptionSrc": "audioDescriptionSrc",
5558
+ "audioDescriptionButton": "audioDescriptionButton",
5559
+ // Other common options
5560
+ "autoplay": "autoplay",
5561
+ "loop": "loop",
5562
+ "muted": "muted",
5563
+ "controls": "controls",
5564
+ "poster": "poster",
5565
+ "width": "width",
5566
+ "height": "height",
5567
+ "language": "language",
5568
+ "captions": "captions",
5569
+ "captionsDefault": "captionsDefault",
5570
+ "transcript": "transcript",
5571
+ "transcriptButton": "transcriptButton",
5572
+ "keyboard": "keyboard",
5573
+ "responsive": "responsive",
5574
+ "pipButton": "pipButton",
5575
+ "fullscreenButton": "fullscreenButton"
5576
+ };
5577
+ Object.keys(attributeMap).forEach((dataKey) => {
5578
+ const optionKey = attributeMap[dataKey];
5579
+ const value = dataset[dataKey];
5580
+ if (value !== void 0) {
5581
+ if (value === "true") {
5582
+ options[optionKey] = true;
5583
+ } else if (value === "false") {
5584
+ options[optionKey] = false;
5585
+ } else if (!isNaN(value) && value !== "") {
5586
+ options[optionKey] = Number(value);
5587
+ } else {
5588
+ options[optionKey] = value;
5589
+ }
5590
+ }
5591
+ });
5592
+ return options;
5593
+ }
5547
5594
  if (document.readyState === "loading") {
5548
5595
  document.addEventListener("DOMContentLoaded", initializePlayers);
5549
5596
  } else {