Skip to content

Instantly share code, notes, and snippets.

@rinsuki
Created November 27, 2017 10:40
Show Gist options
  • Save rinsuki/c5491501afaffb89b4bdddd941436192 to your computer and use it in GitHub Desktop.
Save rinsuki/c5491501afaffb89b4bdddd941436192 to your computer and use it in GitHub Desktop.
// ==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