Fixed floating player issue.
This commit is contained in:
parent
8957e87fc2
commit
a95fd1a9ec
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Better Youtube +",
|
||||
"version": "1.2.8",
|
||||
"version": "1.2.9",
|
||||
"description": "Enhancements for Youtube to have a better experience.",
|
||||
|
||||
"applications": {
|
||||
|
|
|
@ -149,17 +149,30 @@ function betterYoutubePlus() {
|
|||
}
|
||||
|
||||
function toggleFloat() {
|
||||
playerWindow = document.getElementById("player-container").children[1]; // Actual player
|
||||
var playerWindow = document.getElementById("movie_player"); // Actual player
|
||||
|
||||
if(poppedContainer.style.display == "none"){
|
||||
setVideoStyle("auto", "auto", "50%");
|
||||
poppedContainer.appendChild(playerWindow);
|
||||
poppedContainer.style.display = "block";
|
||||
|
||||
} else {
|
||||
setVideoStyle(containerOfPlyrWndow.offsetWidth + "px",
|
||||
containerOfPlyrWndow.offsetHeight + "px", "");
|
||||
containerOfPlyrWndow.append(playerWindow);
|
||||
poppedContainer.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
function setVideoStyle(w, h, pr) {
|
||||
var elm = document.getElementsByClassName("ytp-right-controls")[0];
|
||||
video.style.width = w;
|
||||
video.style.height = h;
|
||||
elm.style.paddingRight = pr;
|
||||
console.log("W: " + w + "\nH: " + h + "\npr: " + pr);
|
||||
console.log(video.style);
|
||||
}
|
||||
|
||||
function manageVolume(e) {
|
||||
var delta;
|
||||
e.preventDefault(); // Keep page from scrolling while in video area
|
||||
|
|
Loading…
Reference in New Issue