PageSourceSearch

https://hideko-piano.com/static/js/youtube.js?1791416719.9863558

js hideko-piano.com collected 2026-10-07 23:46:18 UTC 1,294 bytes, 42 lines download raw bytes

1// https://developers.google.com/youtube/iframe_api_reference?hl=ja
2var tag = document.createElement('script');
3
4tag.src = "https://www.youtube.com/iframe_api";
5var firstScriptTag = document.getElementsByTagName('script')[0];
6firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
7
8var playerList = [];
9
10function onYouTubeIframeAPIReady() {
11    var videoClass = document.getElementsByClassName('videoBox');
12    for(var i = 0; i < videoClass.length; i++) {
13        var playerId = videoClass[i].firstElementChild.id;
14        var videoId = videoClass[i].firstElementChild.dataset.video;
15
16        if(!playerId) {
17            continue; // 既存のYouTubeパーツは対象外
18        } else if(!videoId) {
19            videoId = playerId; // 後方互換
20        }
21
22        var player = new YT.Player(playerId, {
23            height: '315',
24            width: '560',
25            videoId: videoId,
26            events: {
27                'onStateChange': onPlayerStateChange
28            }
29        });
30        playerList.push(player);
31    }
32}
33
34function onPlayerStateChange(event) {
35    if(event.data === YT.PlayerState.PLAYING) {
36        playerList.forEach(function (item, index, array) {
37            if(event.target !== item) {
38                item.pauseVideo();
39            }
40        });
41    }
42}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.