Created
November 27, 2017 10:40
-
-
Save rinsuki/c5491501afaffb89b4bdddd941436192 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name bandai channel picture in picture | |
// @namespace https://rinsuki.github.io/ | |
// @version 0.1 | |
// @description バンダイチャンネルのHTML5プレーヤーでPicture in Pictureを利用できるようにします | |
// @author You | |
// @match http://www.b-ch.com/ttl/index_html5.php?* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var b = document.createElement("button") | |
b.innerText = "Picture in Picture" | |
b.onclick = () => { | |
var video = document.getElementById("bchplayer_html5_api") | |
console.log(video.webkitPresentationMode) | |
video.webkitSetPresentationMode(video.webkitPresentationMode == "inline" ? "picture-in-picture" : "inline") | |
} | |
document.getElementById("player-info").appendChild(b) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment