Hi.
Here is an example:
var root = this;
var videoURL = 'https://www.youtube.com/watch?v=F6X3iCKyY6Q';
var embedURL = '<iframe width="560" height="315" src="https://www.youtube.com/embed/F6X3iCKyY6Q" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
root.embedVideo = function(url, style)
{
var key;
var element = document.createElement('div');
canvas.parentNode.appendChild(element);
element.innerHTML = url;
for (key in style)
element.style[key] = style[key];
};
root.viewButton.on('click', function (e)
{
window.open(videoURL, '_blank');
});
root.stop();
root.embedVideo(embedURL, {position: 'relative', left: (canvas.width - 560) * 0.5 + 'px', top: (canvas.height - 315) * 0.5 + 'px'});
Download the FLA / source / files here:
https://github.com/joao-cesar/adobe/tree/master/animate%20cc/html5_canvas/youtube_video
Regards,
JC