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