/picture-in-picture

Picture in picture JS project 3

Primary LanguageJavaScript

Picture-In-Picture test

3rd Javascript project: Picture in picture.

Resources

Others Demos

Code

Get info about Picture in picture windows

function getPIPInfo() {
  if (pipWindow) {
    console.log(`> Window size is ${pipWindow.width}x${pipWindow.height}`);
    const [track] = video.srcObject.getVideoTracks();
    var events = [];
    for (var property in pipWindow) {
      let match = property.match(/^on(.*)/)
      if (match) {
        events.push(match[1]);
      }
    }
    console.log(events);
  } else {
    console.log('No pip window is currently open...');
  }
}

Can be added in the finally bloc of onclick.