Is there a simple way to embed a Youtube or Vimeo video into a Saola page the way we import a movie file – Ideally using their embed codes so as to fine tune settings of how it plays.
Would the code below turn full screen option ON or do I need to modify it? I tried the one below and was unable to get full screen to work upon clicking the small icon on bottom right of the video.
function onSceneActivated(doc, e) {
var videoFrame = doc.getElement(‘HTML_Widget_1’).embeddedDom;
videoFrame.setAttribute(‘allowfullscreen’, ‘’);
}
No, fullscreen must be initiated by an user interaction (e.g. tap, click).
Setting allowfullscreen attribute is just a necessity for the frame to be fullscreen.
It’s a bug or feature in Chrome.
To make it work on Chrome, you must reload the embedded content:
function onSceneActivated(doc, e) {
var videoFrame = doc.getElement('HTML_Widget_1').embeddedDom;
videoFrame.setAttribute('allowfullscreen', '');
// reload the frame to make allowfullscreen working on Chrome
var videoSrc = videoFrame.src;
videoFrame.src = '';
videoFrame.src = videoSrc;
}
Please try updating Chrome to the latest version: Version 75.0.3770.100 (Official Build)
Regarding full screen Youtube video, I think you can do it with Fullscreen API, and Youtube Player API.
Unfortunately, I don’t have experience with Youtube Player API so I can’t help you coding it.