1
Fork 0
This commit is contained in:
ashley 2024-08-01 11:48:30 +00:00
parent f9474cb95e
commit 6c0a84fc99

View file

@ -618,73 +618,7 @@ background-color: #0000;
<script> <script>
</script> </script>
<% if(shortsui) { %>
<script>
// Function to apply styles after DOM has loaded
function applyStyles() {
const styles = `
.player {
width: fit-content;
margin-left: auto;
margin-right: auto;
height: fit-content;
}
.video-player-container {
max-width: fit-content;
min-width: fit-content;
margin-left: auto;
margin-right: auto;
aspect-ratio: var(--ptd-watch-width-ratio) / var(--ptd-watch-height-ratio);
}
`;
// Create a style element and set its content
const styleElement = document.createElement('style');
styleElement.innerHTML = styles;
// Append the style element to the document head
document.head.appendChild(styleElement);
}
// Event listener to call applyStyles after DOM has loaded
window.onload = applyStyles;
</script>
<% } %>
<% if (inv_vid.author.endsWith(' - Topic')) { %>
<script>
// Function to apply styles after DOM has loaded
function applyStyles() {
const styles = `
.player {
width: fit-content;
margin-left: auto;
margin-right: auto;
height: fit-content;
}
.video-player-container {
max-width: fit-content;
min-width: fit-content;
margin-left: auto;
margin-right: auto;
aspect-ratio: var(--ptd-watch-width-ratio) / var(--ptd-watch-height-ratio);
}
`;
// Create a style element and set its content
const styleElement = document.createElement('style');
styleElement.innerHTML = styles;
// Append the style element to the document head
document.head.appendChild(styleElement);
}
// Event listener to call applyStyles after DOM has loaded
window.onload = applyStyles;
</script>
<% } %>
<% if(dm) { %> <% if(dm) { %>
@ -771,16 +705,20 @@ background-color: #0000;
<% if (!qua) { //TODO - a %> <% if (!qua) { //TODO - a %>
var sources = player.currentSources(); <%
let itag = '136'; // Default itag
// Add the new audio source inv_vid.adaptiveFormats.forEach(format => {
sources.push({ if (format.itag == '298') {
type: 'audio/mp3', itag = '298';
src: '<%=u%>/latest_version?id=<%=inv_vid.videoId%>&itag=140&local=true' }
}); });
%>
player.src([
{ type: "video/mp4", src: "<%=u%>/latest_version?id=<%=inv_vid.videoId%>&itag=<%=itag%>&local=true" },
{ type: "audio/mp3", src: "<%=u%>/latest_version?id=<%=inv_vid.videoId%>&itag=140&local=true" }
]);
// Set the updated source list
player.src(sources);
<% } else { %> <% } else { %>
<% } %> <% } %>
}); });
@ -1068,15 +1006,6 @@ Offical Discord Server! :3
<video class="video-js player video-ambient-container" id="video" style="border-radius: 16px; box-sizing: border-box; min-width: 100%; display: block;" autoplay controls> <video class="video-js player video-ambient-container" id="video" style="border-radius: 16px; box-sizing: border-box; min-width: 100%; display: block;" autoplay controls>
<% if (isvidious) { %> <% if (isvidious) { %>
<% if (!qua) { %> <% if (!qua) { %>
<%
let itag = '136'; // Default itag
inv_vid.adaptiveFormats.forEach(format => {
if (format.itag == '298') {
itag = '298';
}
});
%>
<source src="<%=u%>/latest_version?id=<%=inv_vid.videoId%>&itag=<%=itag%>&local=true" type="video/mp4; codecs=&quot;avc1.64001F, mp4a.40.2&quot;" label="hd720" selected="true">