This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Close fullscreen youtube player when video is opened in min-vid (#398)

- fixes #367
  • Loading branch information...
danrr authored and meandavejustice committed Oct 6, 2016
1 parent d35aec6 commit d270f155676ac89d26d447e95a67c7fb3c1dcad2
Showing with 7 additions and 0 deletions.
  1. +7 −0 data/icon-overlay.js
View
@@ -90,6 +90,7 @@ function ytWatchElementHandler(el) {
evNoop(ev);
const videoEl = document.querySelector('video');
videoEl.pause();
closeFullscreen();
self.port.emit('launch', {
url: window.location.href,
domain: 'youtube.com',
@@ -187,3 +188,9 @@ function evNoop(ev) {
ev.preventDefault();
ev.stopImmediatePropagation();
}
function closeFullscreen() {
if (document.mozFullScreenEnabled) {
document.mozCancelFullScreen();
}
}

0 comments on commit d270f15

Please sign in to comment.