@gcorevideo/player 2.28.30 → 2.28.35
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/core.js +1 -1
- package/dist/index.css +208 -208
- package/dist/index.embed.js +34 -21
- package/dist/index.js +93 -82
- package/docs/api/player.closedcaptionspluginsettings.md +1 -0
- package/docs/api/player.md +9 -0
- package/docs/api/player.mediacontrol.md +16 -0
- package/docs/api/player.thumbnails.md +1 -1
- package/lib/Player.d.ts.map +1 -1
- package/lib/plugins/subtitles/ClosedCaptions.d.ts +6 -2
- package/lib/plugins/subtitles/ClosedCaptions.d.ts.map +1 -1
- package/lib/plugins/subtitles/ClosedCaptions.js +37 -23
- package/package.json +4 -1
- package/src/Player.ts +12 -12
- package/src/plugins/subtitles/ClosedCaptions.ts +42 -28
- package/src/plugins/subtitles/__tests__/ClosedCaptions.test.ts +293 -6
- package/tsconfig.tsbuildinfo +1 -1
package/dist/core.js
CHANGED
|
@@ -51481,7 +51481,7 @@ class Player {
|
|
|
51481
51481
|
}
|
|
51482
51482
|
}
|
|
51483
51483
|
|
|
51484
|
-
var version$1 = "2.28.
|
|
51484
|
+
var version$1 = "2.28.35";
|
|
51485
51485
|
|
|
51486
51486
|
var packages = {
|
|
51487
51487
|
"node_modules/@clappr/core": {
|
package/dist/index.css
CHANGED
|
@@ -643,29 +643,6 @@
|
|
|
643
643
|
.fullscreen .clappr-nerd-stats .stats-box {
|
|
644
644
|
top: unset;
|
|
645
645
|
}
|
|
646
|
-
}@charset "UTF-8";
|
|
647
|
-
.gplayer-mc-clips {
|
|
648
|
-
display: flex;
|
|
649
|
-
gap: 6px;
|
|
650
|
-
}
|
|
651
|
-
.gplayer-mc-clips .gplayer-mc-clips-text {
|
|
652
|
-
text-overflow: ellipsis;
|
|
653
|
-
white-space: nowrap;
|
|
654
|
-
overflow: hidden;
|
|
655
|
-
display: inline-block;
|
|
656
|
-
text-overflow: ellipsis;
|
|
657
|
-
color: white;
|
|
658
|
-
cursor: default;
|
|
659
|
-
line-height: var(--bottom-panel);
|
|
660
|
-
position: relative;
|
|
661
|
-
max-width: 150px;
|
|
662
|
-
}
|
|
663
|
-
.gplayer-mc-clips .gplayer-mc-clips-text::before {
|
|
664
|
-
content: "•";
|
|
665
|
-
padding-right: 6px;
|
|
666
|
-
}
|
|
667
|
-
.gplayer-mc-clips .gplayer-mc-clips-text.compact {
|
|
668
|
-
max-width: 100px;
|
|
669
646
|
}.context-menu {
|
|
670
647
|
z-index: 999;
|
|
671
648
|
position: absolute;
|
|
@@ -702,6 +679,29 @@
|
|
|
702
679
|
.context-menu .context-menu-list-item_icon {
|
|
703
680
|
width: 20px;
|
|
704
681
|
height: 20px;
|
|
682
|
+
}@charset "UTF-8";
|
|
683
|
+
.gplayer-mc-clips {
|
|
684
|
+
display: flex;
|
|
685
|
+
gap: 6px;
|
|
686
|
+
}
|
|
687
|
+
.gplayer-mc-clips .gplayer-mc-clips-text {
|
|
688
|
+
text-overflow: ellipsis;
|
|
689
|
+
white-space: nowrap;
|
|
690
|
+
overflow: hidden;
|
|
691
|
+
display: inline-block;
|
|
692
|
+
text-overflow: ellipsis;
|
|
693
|
+
color: white;
|
|
694
|
+
cursor: default;
|
|
695
|
+
line-height: var(--bottom-panel);
|
|
696
|
+
position: relative;
|
|
697
|
+
max-width: 150px;
|
|
698
|
+
}
|
|
699
|
+
.gplayer-mc-clips .gplayer-mc-clips-text::before {
|
|
700
|
+
content: "•";
|
|
701
|
+
padding-right: 6px;
|
|
702
|
+
}
|
|
703
|
+
.gplayer-mc-clips .gplayer-mc-clips-text.compact {
|
|
704
|
+
max-width: 100px;
|
|
705
705
|
}div.player-error-screen, [data-player] div.player-error-screen {
|
|
706
706
|
color: #CCCACA;
|
|
707
707
|
position: absolute;
|
|
@@ -928,14 +928,40 @@ div.player-error-screen__reload, [data-player] div.player-error-screen__reload {
|
|
|
928
928
|
}
|
|
929
929
|
.multicamera[data-multicamera] li.current a {
|
|
930
930
|
color: #f00;
|
|
931
|
-
}.
|
|
932
|
-
|
|
931
|
+
}.player-poster {
|
|
932
|
+
display: flex;
|
|
933
|
+
justify-content: center;
|
|
934
|
+
align-items: center;
|
|
935
|
+
position: absolute;
|
|
936
|
+
height: 100%;
|
|
937
|
+
width: 100%;
|
|
938
|
+
z-index: 998;
|
|
939
|
+
top: 0;
|
|
940
|
+
left: 0;
|
|
941
|
+
background-color: #000;
|
|
942
|
+
background-size: cover;
|
|
943
|
+
background-repeat: no-repeat;
|
|
944
|
+
background-position: 50% 50%;
|
|
933
945
|
}
|
|
934
|
-
.
|
|
935
|
-
|
|
946
|
+
.player-poster.clickable {
|
|
947
|
+
cursor: pointer;
|
|
936
948
|
}
|
|
937
|
-
.
|
|
938
|
-
|
|
949
|
+
.player-poster:hover .play-wrapper {
|
|
950
|
+
opacity: 1;
|
|
951
|
+
}
|
|
952
|
+
.player-poster .play-wrapper {
|
|
953
|
+
width: 100%;
|
|
954
|
+
height: 25%;
|
|
955
|
+
margin: 0 auto;
|
|
956
|
+
opacity: 0.75;
|
|
957
|
+
transition: opacity 0.1s ease;
|
|
958
|
+
}
|
|
959
|
+
.player-poster .play-wrapper svg {
|
|
960
|
+
height: 100%;
|
|
961
|
+
display: inline;
|
|
962
|
+
}
|
|
963
|
+
.player-poster .play-wrapper svg path {
|
|
964
|
+
fill: #fff;
|
|
939
965
|
}[data-player] {
|
|
940
966
|
--bottom-panel: 40px;
|
|
941
967
|
}
|
|
@@ -1557,40 +1583,169 @@ div.player-error-screen__reload, [data-player] div.player-error-screen__reload {
|
|
|
1557
1583
|
100% {
|
|
1558
1584
|
color: #B80000;
|
|
1559
1585
|
}
|
|
1560
|
-
}.
|
|
1586
|
+
}.media-control-skin-1 .media-control-item.media-control-pip {
|
|
1587
|
+
order: 95;
|
|
1588
|
+
}
|
|
1589
|
+
.media-control-skin-1 .media-control-item.media-control-pip button {
|
|
1590
|
+
height: 20px;
|
|
1591
|
+
}
|
|
1592
|
+
.media-control-skin-1 .media-control-item.media-control-pip button svg {
|
|
1593
|
+
height: 20px;
|
|
1594
|
+
}.quality-levels li.disabled {
|
|
1595
|
+
opacity: 0.5;
|
|
1596
|
+
pointer-events: none;
|
|
1597
|
+
}
|
|
1598
|
+
.quality-levels li.current {
|
|
1599
|
+
background-color: #000;
|
|
1600
|
+
}.seek-time {
|
|
1601
|
+
position: absolute;
|
|
1602
|
+
white-space: nowrap;
|
|
1603
|
+
height: 20px;
|
|
1604
|
+
line-height: 20px;
|
|
1605
|
+
font-size: 0;
|
|
1606
|
+
left: -100%;
|
|
1607
|
+
bottom: 55px;
|
|
1608
|
+
background-color: rgba(2, 2, 2, 0.5);
|
|
1609
|
+
z-index: 9999;
|
|
1610
|
+
transition: opacity 0.1s ease;
|
|
1611
|
+
}
|
|
1612
|
+
.seek-time.hidden {
|
|
1613
|
+
opacity: 0;
|
|
1614
|
+
}
|
|
1615
|
+
.seek-time .seek-time__pos {
|
|
1616
|
+
display: inline-block;
|
|
1617
|
+
color: white;
|
|
1618
|
+
font-size: 10px;
|
|
1619
|
+
padding-left: 7px;
|
|
1620
|
+
padding-right: 7px;
|
|
1621
|
+
vertical-align: top;
|
|
1622
|
+
}
|
|
1623
|
+
.seek-time .seek-time__duration {
|
|
1624
|
+
display: inline-block;
|
|
1625
|
+
color: rgba(255, 255, 255, 0.5);
|
|
1626
|
+
font-size: 10px;
|
|
1627
|
+
padding-right: 7px;
|
|
1628
|
+
vertical-align: top;
|
|
1629
|
+
}
|
|
1630
|
+
.seek-time .seek-time__duration::before {
|
|
1631
|
+
content: "|";
|
|
1632
|
+
margin-right: 7px;
|
|
1633
|
+
}.container-with-poster-clickable .mc-skip-time {
|
|
1634
|
+
height: 0;
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
.mc-skip-time {
|
|
1638
|
+
position: absolute;
|
|
1639
|
+
width: 100%;
|
|
1640
|
+
height: calc(100% - 50px);
|
|
1641
|
+
z-index: 9998;
|
|
1642
|
+
background-color: transparent;
|
|
1643
|
+
font-family: Roboto, "Open Sans", Arial, sans-serif;
|
|
1644
|
+
}
|
|
1645
|
+
.mc-skip-time .skip-container {
|
|
1646
|
+
width: 100%;
|
|
1647
|
+
height: 100%;
|
|
1648
|
+
display: flex;
|
|
1649
|
+
justify-content: space-between;
|
|
1650
|
+
}
|
|
1651
|
+
.mc-skip-time .skip-container .skip-item {
|
|
1652
|
+
flex: 1 0 0px;
|
|
1653
|
+
height: 100%;
|
|
1654
|
+
}.media-control-skin-1 .media-control-cc button.media-control-button {
|
|
1561
1655
|
display: flex;
|
|
1562
1656
|
justify-content: center;
|
|
1657
|
+
padding: 0;
|
|
1563
1658
|
align-items: center;
|
|
1564
|
-
|
|
1565
|
-
height: 100%;
|
|
1566
|
-
width: 100%;
|
|
1567
|
-
z-index: 998;
|
|
1568
|
-
top: 0;
|
|
1569
|
-
left: 0;
|
|
1570
|
-
background-color: #000;
|
|
1571
|
-
background-size: cover;
|
|
1572
|
-
background-repeat: no-repeat;
|
|
1573
|
-
background-position: 50% 50%;
|
|
1659
|
+
vertical-align: top;
|
|
1574
1660
|
}
|
|
1575
|
-
.
|
|
1576
|
-
|
|
1661
|
+
.media-control-skin-1 .media-control-cc button.media-control-button:hover {
|
|
1662
|
+
color: white;
|
|
1577
1663
|
}
|
|
1578
|
-
.
|
|
1579
|
-
|
|
1664
|
+
.media-control-skin-1 .media-control-cc ul li {
|
|
1665
|
+
text-align: center;
|
|
1580
1666
|
}
|
|
1581
|
-
.
|
|
1667
|
+
.media-control-skin-1 .media-control-cc ul li a {
|
|
1668
|
+
height: 30px;
|
|
1669
|
+
padding: 5px 10px;
|
|
1670
|
+
color: #fffffe;
|
|
1671
|
+
}
|
|
1672
|
+
.media-control-skin-1 .media-control-cc ul li a:hover {
|
|
1673
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
1674
|
+
}
|
|
1675
|
+
.media-control-skin-1 .media-control-cc ul li.current a {
|
|
1676
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
1677
|
+
}
|
|
1678
|
+
.media-control-skin-1 .media-control-cc ul li:first-child a {
|
|
1679
|
+
border-bottom-left-radius: 4px;
|
|
1680
|
+
border-bottom-right-radius: 4px;
|
|
1681
|
+
}
|
|
1682
|
+
.media-control-skin-1 .media-control-cc ul li:last-child a {
|
|
1683
|
+
border-top-left-radius: 4px;
|
|
1684
|
+
border-top-right-radius: 4px;
|
|
1685
|
+
}
|
|
1686
|
+
.media-control-skin-1 .media-control-cc {
|
|
1687
|
+
position: relative;
|
|
1688
|
+
order: 85;
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
::cue {
|
|
1692
|
+
visibility: hidden !important;
|
|
1693
|
+
font-size: 0 !important;
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
.ios-fullscreen::cue {
|
|
1697
|
+
visibility: visible !important;
|
|
1698
|
+
font-size: 1em !important;
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
.container .gplayer-cc-line {
|
|
1702
|
+
position: absolute;
|
|
1703
|
+
bottom: calc(var(--bottom-panel) + 5px);
|
|
1582
1704
|
width: 100%;
|
|
1583
|
-
|
|
1705
|
+
}
|
|
1706
|
+
.container .gplayer-cc-line p {
|
|
1707
|
+
width: auto;
|
|
1708
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
1709
|
+
color: white;
|
|
1710
|
+
display: inline-block;
|
|
1711
|
+
}.spinner-three-bounce[data-spinner] {
|
|
1712
|
+
position: absolute;
|
|
1713
|
+
width: 70px;
|
|
1714
|
+
text-align: center;
|
|
1715
|
+
z-index: 999;
|
|
1716
|
+
left: 0;
|
|
1717
|
+
right: 0;
|
|
1584
1718
|
margin: 0 auto;
|
|
1585
|
-
|
|
1586
|
-
|
|
1719
|
+
margin-left: auto;
|
|
1720
|
+
margin-right: auto;
|
|
1721
|
+
/* center vertically */
|
|
1722
|
+
top: 50%;
|
|
1723
|
+
transform: translateY(-50%);
|
|
1587
1724
|
}
|
|
1588
|
-
.
|
|
1589
|
-
|
|
1590
|
-
|
|
1725
|
+
.spinner-three-bounce[data-spinner] > div {
|
|
1726
|
+
width: 18px;
|
|
1727
|
+
height: 18px;
|
|
1728
|
+
background-color: #FFF;
|
|
1729
|
+
border-radius: 100%;
|
|
1730
|
+
display: inline-block;
|
|
1731
|
+
animation: bouncedelay 1.4s infinite ease-in-out;
|
|
1732
|
+
/* Prevent first frame from flickering when animation starts */
|
|
1733
|
+
animation-fill-mode: both;
|
|
1591
1734
|
}
|
|
1592
|
-
.
|
|
1593
|
-
|
|
1735
|
+
.spinner-three-bounce[data-spinner] [data-bounce1] {
|
|
1736
|
+
animation-delay: -0.32s;
|
|
1737
|
+
}
|
|
1738
|
+
.spinner-three-bounce[data-spinner] [data-bounce2] {
|
|
1739
|
+
animation-delay: -0.16s;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
@keyframes bouncedelay {
|
|
1743
|
+
0%, 80%, 100% {
|
|
1744
|
+
transform: scale(0);
|
|
1745
|
+
}
|
|
1746
|
+
40% {
|
|
1747
|
+
transform: scale(1);
|
|
1748
|
+
}
|
|
1594
1749
|
}.share_plugin[data-share] {
|
|
1595
1750
|
pointer-events: auto;
|
|
1596
1751
|
z-index: 5;
|
|
@@ -1674,104 +1829,6 @@ div.player-error-screen__reload, [data-player] div.player-error-screen__reload {
|
|
|
1674
1829
|
display: inline-block;
|
|
1675
1830
|
margin-right: 5px;
|
|
1676
1831
|
cursor: pointer;
|
|
1677
|
-
}.seek-time {
|
|
1678
|
-
position: absolute;
|
|
1679
|
-
white-space: nowrap;
|
|
1680
|
-
height: 20px;
|
|
1681
|
-
line-height: 20px;
|
|
1682
|
-
font-size: 0;
|
|
1683
|
-
left: -100%;
|
|
1684
|
-
bottom: 55px;
|
|
1685
|
-
background-color: rgba(2, 2, 2, 0.5);
|
|
1686
|
-
z-index: 9999;
|
|
1687
|
-
transition: opacity 0.1s ease;
|
|
1688
|
-
}
|
|
1689
|
-
.seek-time.hidden {
|
|
1690
|
-
opacity: 0;
|
|
1691
|
-
}
|
|
1692
|
-
.seek-time .seek-time__pos {
|
|
1693
|
-
display: inline-block;
|
|
1694
|
-
color: white;
|
|
1695
|
-
font-size: 10px;
|
|
1696
|
-
padding-left: 7px;
|
|
1697
|
-
padding-right: 7px;
|
|
1698
|
-
vertical-align: top;
|
|
1699
|
-
}
|
|
1700
|
-
.seek-time .seek-time__duration {
|
|
1701
|
-
display: inline-block;
|
|
1702
|
-
color: rgba(255, 255, 255, 0.5);
|
|
1703
|
-
font-size: 10px;
|
|
1704
|
-
padding-right: 7px;
|
|
1705
|
-
vertical-align: top;
|
|
1706
|
-
}
|
|
1707
|
-
.seek-time .seek-time__duration::before {
|
|
1708
|
-
content: "|";
|
|
1709
|
-
margin-right: 7px;
|
|
1710
|
-
}.spinner-three-bounce[data-spinner] {
|
|
1711
|
-
position: absolute;
|
|
1712
|
-
width: 70px;
|
|
1713
|
-
text-align: center;
|
|
1714
|
-
z-index: 999;
|
|
1715
|
-
left: 0;
|
|
1716
|
-
right: 0;
|
|
1717
|
-
margin: 0 auto;
|
|
1718
|
-
margin-left: auto;
|
|
1719
|
-
margin-right: auto;
|
|
1720
|
-
/* center vertically */
|
|
1721
|
-
top: 50%;
|
|
1722
|
-
transform: translateY(-50%);
|
|
1723
|
-
}
|
|
1724
|
-
.spinner-three-bounce[data-spinner] > div {
|
|
1725
|
-
width: 18px;
|
|
1726
|
-
height: 18px;
|
|
1727
|
-
background-color: #FFF;
|
|
1728
|
-
border-radius: 100%;
|
|
1729
|
-
display: inline-block;
|
|
1730
|
-
animation: bouncedelay 1.4s infinite ease-in-out;
|
|
1731
|
-
/* Prevent first frame from flickering when animation starts */
|
|
1732
|
-
animation-fill-mode: both;
|
|
1733
|
-
}
|
|
1734
|
-
.spinner-three-bounce[data-spinner] [data-bounce1] {
|
|
1735
|
-
animation-delay: -0.32s;
|
|
1736
|
-
}
|
|
1737
|
-
.spinner-three-bounce[data-spinner] [data-bounce2] {
|
|
1738
|
-
animation-delay: -0.16s;
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
@keyframes bouncedelay {
|
|
1742
|
-
0%, 80%, 100% {
|
|
1743
|
-
transform: scale(0);
|
|
1744
|
-
}
|
|
1745
|
-
40% {
|
|
1746
|
-
transform: scale(1);
|
|
1747
|
-
}
|
|
1748
|
-
}.quality-levels li.disabled {
|
|
1749
|
-
opacity: 0.5;
|
|
1750
|
-
pointer-events: none;
|
|
1751
|
-
}
|
|
1752
|
-
.quality-levels li.current {
|
|
1753
|
-
background-color: #000;
|
|
1754
|
-
}.container-with-poster-clickable .mc-skip-time {
|
|
1755
|
-
height: 0;
|
|
1756
|
-
}
|
|
1757
|
-
|
|
1758
|
-
.mc-skip-time {
|
|
1759
|
-
position: absolute;
|
|
1760
|
-
width: 100%;
|
|
1761
|
-
height: calc(100% - 50px);
|
|
1762
|
-
z-index: 9998;
|
|
1763
|
-
background-color: transparent;
|
|
1764
|
-
font-family: Roboto, "Open Sans", Arial, sans-serif;
|
|
1765
|
-
}
|
|
1766
|
-
.mc-skip-time .skip-container {
|
|
1767
|
-
width: 100%;
|
|
1768
|
-
height: 100%;
|
|
1769
|
-
display: flex;
|
|
1770
|
-
justify-content: space-between;
|
|
1771
|
-
}
|
|
1772
|
-
.mc-skip-time .skip-container .skip-item {
|
|
1773
|
-
flex: 1 0 0px;
|
|
1774
|
-
height: 100%;
|
|
1775
1832
|
}.scrub-thumbnails {
|
|
1776
1833
|
position: absolute;
|
|
1777
1834
|
bottom: 52px;
|
|
@@ -1835,63 +1892,6 @@ div.player-error-screen__reload, [data-player] div.player-error-screen__reload {
|
|
|
1835
1892
|
}
|
|
1836
1893
|
.scrub-thumbnails .backdrop .carousel img {
|
|
1837
1894
|
width: auto;
|
|
1838
|
-
}.media-control-skin-1 .media-control-cc button.media-control-button {
|
|
1839
|
-
display: flex;
|
|
1840
|
-
justify-content: center;
|
|
1841
|
-
padding: 0;
|
|
1842
|
-
align-items: center;
|
|
1843
|
-
vertical-align: top;
|
|
1844
|
-
}
|
|
1845
|
-
.media-control-skin-1 .media-control-cc button.media-control-button:hover {
|
|
1846
|
-
color: white;
|
|
1847
|
-
}
|
|
1848
|
-
.media-control-skin-1 .media-control-cc ul li {
|
|
1849
|
-
text-align: center;
|
|
1850
|
-
}
|
|
1851
|
-
.media-control-skin-1 .media-control-cc ul li a {
|
|
1852
|
-
height: 30px;
|
|
1853
|
-
padding: 5px 10px;
|
|
1854
|
-
color: #fffffe;
|
|
1855
|
-
}
|
|
1856
|
-
.media-control-skin-1 .media-control-cc ul li a:hover {
|
|
1857
|
-
background-color: rgba(0, 0, 0, 0.4);
|
|
1858
|
-
}
|
|
1859
|
-
.media-control-skin-1 .media-control-cc ul li.current a {
|
|
1860
|
-
background-color: rgba(0, 0, 0, 0.4);
|
|
1861
|
-
}
|
|
1862
|
-
.media-control-skin-1 .media-control-cc ul li:first-child a {
|
|
1863
|
-
border-bottom-left-radius: 4px;
|
|
1864
|
-
border-bottom-right-radius: 4px;
|
|
1865
|
-
}
|
|
1866
|
-
.media-control-skin-1 .media-control-cc ul li:last-child a {
|
|
1867
|
-
border-top-left-radius: 4px;
|
|
1868
|
-
border-top-right-radius: 4px;
|
|
1869
|
-
}
|
|
1870
|
-
.media-control-skin-1 .media-control-cc {
|
|
1871
|
-
position: relative;
|
|
1872
|
-
order: 85;
|
|
1873
|
-
}
|
|
1874
|
-
|
|
1875
|
-
::cue {
|
|
1876
|
-
visibility: hidden !important;
|
|
1877
|
-
font-size: 0 !important;
|
|
1878
|
-
}
|
|
1879
|
-
|
|
1880
|
-
.ios-fullscreen::cue {
|
|
1881
|
-
visibility: visible !important;
|
|
1882
|
-
font-size: 1em !important;
|
|
1883
|
-
}
|
|
1884
|
-
|
|
1885
|
-
.container .gplayer-cc-line {
|
|
1886
|
-
position: absolute;
|
|
1887
|
-
bottom: calc(var(--bottom-panel) + 5px);
|
|
1888
|
-
width: 100%;
|
|
1889
|
-
}
|
|
1890
|
-
.container .gplayer-cc-line p {
|
|
1891
|
-
width: auto;
|
|
1892
|
-
background-color: rgba(0, 0, 0, 0.4);
|
|
1893
|
-
color: white;
|
|
1894
|
-
display: inline-block;
|
|
1895
1895
|
}.player-logo[data-logo] {
|
|
1896
1896
|
position: absolute;
|
|
1897
1897
|
z-index: 2;
|
package/dist/index.embed.js
CHANGED
|
@@ -58560,7 +58560,6 @@ const comboboxHTML = "<button\n class='media-control-button media-control-ico
|
|
|
58560
58560
|
const stringHTML = "<div class=\"gplayer-cc-line\" id=\"gplayer-cc-line\">\n <p></p>\n</div>\n";
|
|
58561
58561
|
|
|
58562
58562
|
const VERSION = '2.19.14';
|
|
58563
|
-
const LOCAL_STORAGE_CC_ID = 'gplayer.plugins.cc.selected';
|
|
58564
58563
|
/**
|
|
58565
58564
|
* `PLUGIN` that provides a UI to select the subtitles when available.
|
|
58566
58565
|
* @public
|
|
@@ -58597,9 +58596,10 @@ const LOCAL_STORAGE_CC_ID = 'gplayer.plugins.cc.selected';
|
|
|
58597
58596
|
* ```
|
|
58598
58597
|
*/
|
|
58599
58598
|
class ClosedCaptions extends UICorePlugin {
|
|
58600
|
-
|
|
58599
|
+
isSelectedApplied = false;
|
|
58601
58600
|
active = false;
|
|
58602
58601
|
open = false;
|
|
58602
|
+
userSelectedItemId = -1;
|
|
58603
58603
|
track = null;
|
|
58604
58604
|
tracks = [];
|
|
58605
58605
|
$line = null;
|
|
@@ -58697,7 +58697,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58697
58697
|
video.classList.remove('ios-fullscreen');
|
|
58698
58698
|
}
|
|
58699
58699
|
});
|
|
58700
|
-
this.
|
|
58700
|
+
this.isSelectedApplied = false;
|
|
58701
58701
|
}
|
|
58702
58702
|
onPlaybackReady() {
|
|
58703
58703
|
this.core.activePlayback.oncueenter = (e) => {
|
|
@@ -58720,7 +58720,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58720
58720
|
this.activateTrack(id);
|
|
58721
58721
|
}
|
|
58722
58722
|
activateTrack(id) {
|
|
58723
|
-
if (['dash', 'hls'].includes(this.core.activePlayback
|
|
58723
|
+
if (this.core.activePlayback && ['dash', 'hls'].includes(this.core.activePlayback.name)) {
|
|
58724
58724
|
this.core.activePlayback.setTextTrack(id);
|
|
58725
58725
|
return;
|
|
58726
58726
|
}
|
|
@@ -58757,7 +58757,7 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58757
58757
|
try {
|
|
58758
58758
|
// TODO ensure to apply only once
|
|
58759
58759
|
this.currentTracks = this.core.activePlayback.closedCaptionsTracks;
|
|
58760
|
-
this.
|
|
58760
|
+
this.applySelectedSubtitles();
|
|
58761
58761
|
this.render();
|
|
58762
58762
|
}
|
|
58763
58763
|
catch (error) {
|
|
@@ -58862,22 +58862,36 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58862
58862
|
}
|
|
58863
58863
|
onItemSelect(event) {
|
|
58864
58864
|
// event.target does not exist for some reason in tests
|
|
58865
|
-
const id = (event.target ?? event.currentTarget).dataset?.item ??
|
|
58866
|
-
'-1';
|
|
58867
|
-
|
|
58868
|
-
|
|
58865
|
+
const id = Number((event.target ?? event.currentTarget).dataset?.item ??
|
|
58866
|
+
'-1');
|
|
58867
|
+
// TODO review, make configurable, and emit event in addition
|
|
58868
|
+
// localStorage.setItem(LOCAL_STORAGE_CC_ID, id) // TODO store language instead?
|
|
58869
|
+
this.userSelectedItemId = id;
|
|
58870
|
+
this.selectItem(this.findById(id));
|
|
58869
58871
|
this.hideMenu();
|
|
58870
58872
|
return false;
|
|
58871
58873
|
}
|
|
58872
|
-
|
|
58873
|
-
if (
|
|
58874
|
-
|
|
58875
|
-
|
|
58876
|
-
|
|
58877
|
-
|
|
58878
|
-
|
|
58879
|
-
|
|
58874
|
+
applySelectedSubtitles() {
|
|
58875
|
+
if (this.isSelectedApplied) {
|
|
58876
|
+
return;
|
|
58877
|
+
}
|
|
58878
|
+
this.isSelectedApplied = true;
|
|
58879
|
+
// If user selected a language, activate that
|
|
58880
|
+
// Otherwise, if there is no configured language, then let the engine decide
|
|
58881
|
+
// To hide the subtitles initially forcefully, set the language to 'none'
|
|
58882
|
+
let matcher;
|
|
58883
|
+
if (this.userSelectedItemId !== -1) {
|
|
58884
|
+
matcher = (track) => track.id === this.userSelectedItemId;
|
|
58880
58885
|
}
|
|
58886
|
+
else if (this.preselectedLanguage) {
|
|
58887
|
+
matcher = (track) => this.isPreselectedLanguage(track.track.language);
|
|
58888
|
+
}
|
|
58889
|
+
else {
|
|
58890
|
+
return;
|
|
58891
|
+
}
|
|
58892
|
+
setTimeout(() => {
|
|
58893
|
+
this.selectItem(this.tracks.find(matcher) ?? null);
|
|
58894
|
+
}, 0);
|
|
58881
58895
|
}
|
|
58882
58896
|
hideMenu() {
|
|
58883
58897
|
this.open = false;
|
|
@@ -58911,10 +58925,9 @@ class ClosedCaptions extends UICorePlugin {
|
|
|
58911
58925
|
return this.$el.find('#gplayer-cc-menu li'); // TODO fix semantically
|
|
58912
58926
|
}
|
|
58913
58927
|
selectSubtitles() {
|
|
58914
|
-
|
|
58915
|
-
|
|
58916
|
-
|
|
58917
|
-
// this.core.activePlayback.closedCaptionsTrackId = -1
|
|
58928
|
+
if (this.currentTrack) {
|
|
58929
|
+
this.core.activePlayback.closedCaptionsTrackId = this.currentTrack.id;
|
|
58930
|
+
}
|
|
58918
58931
|
}
|
|
58919
58932
|
getSubtitleText(track) {
|
|
58920
58933
|
const currentTime = this.core.activePlayback?.getCurrentTime() ?? 0;
|