By George, I think she's got it!
If you go to this page:
http://sdfo.org/play/Pop/NewPlayer.html you'll be able to launch the player by clicking on the button the first time, and enqueue a new playlist into the existing window by clicking on the button the second time. You'll need to scroll down to see the new additions to the playlist.
To aba and all coders: I need just a little bit of help to make this work completely with kPlaylist. If you have the time and are willing, I'd be grateful if you'd look at the following three suggestions.
1. Please check out the jwplayerInclude.php file here:
http://sdfo.org/play/Pop/jwplayerInclude.zip. This is my replacement for the jwplayer class (I tried to integrate it as much as possible into the existing setup, but of course it will probably need further modifications). For build 493, this replaces lines 15319 through 15397.
2. The function that creates the jwplayer will need to be modified. When triggered, it should first check if the player window exists. If it doesn't, jwplayer can be created normally. If it does exist, however, the command to "popuphandle.loadXMLDoc" should be triggered. This is the code from my test page that does this. Of course it will need to be modified to fit into kPlaylist.
- Code: Select all
function openPopup(theFile) {
var url = "PlayPop.php";
popupWin = open("", "popupWin", "width=500,height=500" ); //if the player window exists, this will connect to it. If it does not, this pops up a blank window which the next line turns into a player window.
if( !popupWin || popupWin.closed || !popupWin.createPlayer ) {
popupWin = window.open( url, "popupWin", "width=500,height=500" );
} else popupWin.focus();
popupWin.loadXMLDoc(theFile);
}
3. The last modification involves a change to or replacement for xml_link, which is part of the jwplayer class. The function that loads the xml doc into the player window chokes on unencoded location and image urls (it won't load the xml file because of the equal signs and whatnot). Therefore, if the player window is being popped up for the first time, a normal playlist must be used, BUT if the player already exists, the location and image tags must be urlencoded in the xml playlist, thusly:
- Code: Select all
$this->data .= '<image>'.urlencode($imgurl).'</image>'.$this->crlf;
$this->data .= '<location>'.urlencode($url).'</location>'.$this->crlf;
With these three modifications, kPlaylist could enqueue new playlists to the JW Player without reloading the player each time. I've done as much as I can on my own, but I don't feel that I understand the code of kPlayer well enough to integrate them into the existing setup properly.
If someone else is willing to take a look at my code and see if they can integrate it based on my suggestions, I would be grateful. I think this would be a terrific addition to kPlaylist.
Thank you,
-Janice
aka kirax2
P.S. Sometimes I'm not good at explaining things. Please feel free to ask for further clarification if anything I've said doesn't make sense. Thanks!