I'm doing it like so but the frames listed are 0, and I can't use 'getElementbyID() on the iframe's name either -
Code: Select all
pmplayerwindowref = window.open("chrome://pmplayer/content/window-youtube.xul", "pmplayerwindow",
"chrome,width=640,height=480,resizable=yes,dialog, alwaysRaised,centerscreen");
pmplayerwindowref.frames[0].setAttribute('src',PMPlayer.Launch.playerIframeSrc);
Code: Select all
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://pmplayer/skin/overlay.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pmplayer/locale/pmplayer.dtd" >
<window id="pmplayer-window" title="PMPlayer" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" fullscreenbutton="true" disablefastfind="true" onunload="PMPlayer.Launch.closeWindow()" >
<script type="application/x-javascript" src="youtubeplayer.js" />
<script type="application/x-javascript" src="launch.js" />
<vbox>
<iframe id="pmplayer-iframe" type="content"/>
<hbox>
<button id="pmplayer-playpause"/>
</hbox>
</vbox>
</window>
I've confirmed that I can load the video if I simply hardcode it, for example setting the iframe src to
Code: Select all
https://www.youtube.com/embed/VIDEOID?enablejsapi=1&modestbranding=1
This is to be an overlay version of the Jetpack based 'Youtube Video Player Pop Out' from CAA with a few additional features (support for a few other video sites as well) and enhancements.