1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 10:19:24 +02:00
Daniel Neto 2023-10-25 10:14:46 -03:00
parent b6d47e94c8
commit 65f15c7e46
2882 changed files with 382239 additions and 10785 deletions

View file

@ -6,7 +6,7 @@
representationsEl.addEventListener('change', function() {
var selectedIndex = representationsEl.selectedIndex;
if (!selectedIndex || selectedIndex < 1 || !window.vhs) {
if (selectedIndex < 0 || !window.vhs) {
return;
}
var selectedOption = representationsEl.options[representationsEl.selectedIndex];
@ -432,6 +432,27 @@
}, 100);
};
var setupContentSteeringData = function(player) {
var currentPathwayEl = document.querySelector('.current-pathway');
var availablePathwaysEl = document.querySelector('.available-pathways');
var steeringManifestEl = document.querySelector('.steering-manifest');
player.one('loadedmetadata', function() {
var steeringController = player.tech_.vhs.playlistController_.contentSteeringController_;
if (!steeringController) {
return;
}
var onContentSteering = function() {
currentPathwayEl.textContent = steeringController.currentPathway;
availablePathwaysEl.textContent = Array.from(steeringController.availablePathways_).join(', ');
steeringManifestEl.textContent = JSON.stringify(steeringController.steeringManifest);
};
steeringController.on('content-steering', onContentSteering);
});
};
[
'debug',
'autoplay',
@ -449,9 +470,11 @@
'pixel-diff-selector',
'network-info',
'dts-offset',
'offset-each-segment',
'override-native',
'preload',
'mirror-source'
'mirror-source',
'forced-subtitles'
].forEach(function(name) {
stateEls[name] = document.getElementById(name);
});
@ -503,7 +526,9 @@
'pixel-diff-selector',
'network-info',
'dts-offset',
'exact-manifest-timings'
'offset-each-segment',
'exact-manifest-timings',
'forced-subtitles'
].forEach(function(name) {
stateEls[name].addEventListener('change', function(event) {
saveState();
@ -585,13 +610,16 @@
exactManifestTimings: getInputValue(stateEls['exact-manifest-timings']),
leastPixelDiffSelector: getInputValue(stateEls['pixel-diff-selector']),
useNetworkInformationApi: getInputValue(stateEls['network-info']),
useDtsForTimestampOffset: getInputValue(stateEls['dts-offset'])
useDtsForTimestampOffset: getInputValue(stateEls['dts-offset']),
calculateTimestampOffsetForEachSegment: getInputValue(stateEls['offset-each-segment']),
useForcedSubtitles: getInputValue(stateEls['forced-subtitles'])
}
}
});
setupPlayerStats(player);
setupSegmentMetadata(player);
setupContentSteeringData(player);
// save player muted state interation
player.on('volumechange', function() {