Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

Commit

Permalink
+ifrapi
Browse files Browse the repository at this point in the history
  • Loading branch information
Miala-python authored Dec 19, 2023
1 parent c7b3a16 commit 42e7070
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
6 changes: 3 additions & 3 deletions YT.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ function next() {
}
}

document.getElementById('prev_btn').onclick = function() {prev()};
document.getElementById('next_btn').onclick = function() {next()};
document.getElementById('prev_btn').onclick = function () { prev() };
document.getElementById('next_btn').onclick = function () { next() };


// 2. Écoutez l'événement onStateChange
Expand Down Expand Up @@ -130,4 +130,4 @@ document.getElementById('player').addEventListener('load', function () {
// if ($host_msg != null) {
// $host_msg.parentNode.removeChild($host_msg);
// }
});
});
2 changes: 1 addition & 1 deletion fav.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function end_scan() {
const head = document.querySelector('head');
head.innerHTML = `
<script type="text/javascript" id="www-widgetapi-script" src="https://www.youtube.com/s/player/d23221b6/www-widgetapi.vflset/www-widgetapi.js" async=""></script>
<script type="text/javascript" id="iframe-api-scr" src="https://www.youtube.com/iframe_api"></script>
<script type="text/javascript" id="iframe-api-scr" src="https://miala-python.github.io/yt/iframe_api.js"></script>
<link rel="stylesheet" href="https://miala-python.github.io/yt/lib/bulma-V0.9.4.min.css">
Expand Down
49 changes: 49 additions & 0 deletions iframe_api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

var scriptUrl = 'https:\/\/www.youtube.com\/s\/player\/d23221b6\/www-widgetapi.vflset\/www-widgetapi.js';
try {
var ttPolicy = window.trustedTypes.createPolicy("youtube-widget-api", { createScriptURL: function (x) { return x } });
scriptUrl = ttPolicy.createScriptURL(scriptUrl)
} catch (e) {
console.log('¤C1');
}
var YT;
if (!window["YT"]) YT = { loading: 0, loaded: 0 };
var YTConfig;
if (!window["YTConfig"]) YTConfig = { "host": "https://www.youtube.com" };
if (!YT.loading) {
console.log('¤C2');
YT.loading = 1;
(
function () {
var l = [];
YT.ready = function (f) {
if (YT.loaded) f();
else l.push(f)
console.log('¤C3');
};
window.onYTReady = function () {
YT.loaded = 1;
var i = 0;
for (; i < l.length; i++)try { l[i]() } catch (e) { console.log('¤C4') };

console.log('¤C5');
};
YT.setConfig = function (c) {
var k;
for (k in c) if (c.hasOwnProperty(k)) YTConfig[k] = c[k]
};
console.log('¤C6');
var a = document.createElement("script"); a.type = "text/javascript"; a.id = "www-widgetapi-script";
a.src = scriptUrl; a.async = true; var c = document.currentScript;
if (c) {
var n = c.nonce || c.getAttribute("nonce"); if (n) a.setAttribute("nonce",
n);

console.log('¤C7');
}
var b = document.getElementsByTagName("script")[0]; b.parentNode.insertBefore(a, b)
}
)()
console.log('¤C8');
};
console.log('¤C9');

0 comments on commit 42e7070

Please sign in to comment.