We currently have a page which allows you to control which track is being played using the Javascript navigation.
Here's our current integration: http://www.skiddle.com/djs/james-ryan/mixes.html
Ideally I'd like to extend this to offer a 'add track to playlist' function, with the player in a *popup window*. That way people can navigate around different profiles, find tracks they like and add it to the popup window, which stays open even if navigating away from the current page
I'm working on some demos of popups, both in a new window and in a <div> on the same page.
The basic method is to open a named popup window and then write to that window instead of the main window.
The popup is another complete HTML page with the JS code to add to the playlist. When you initially pop it up, you send it the current playlist. Then as the user adds selections, you write to the playlist in the popup window.
Call this function: bc.. functionpopUpVideos(popurl,popwidth,popheight,move_x,move_y,aFile) { bFile=encodeURIComponent(aFile); popup=window.open(popurl,'win','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,width='+popwidth+',height='+popheight); popup.moveTo(move_x,move_y); self.name="mainWin";
setTimeout("popup.createPlayer(bFile)",750); }
with something like this (image popup): bc.. <a href="#" onclick="popUpVideos('popup-1.html', '340', '352', '600', '200', 'another_video.flv'); return false;"><img src="image01_thumb.jpg" alt="Click to open PopUp 1" width="40" height="40" border="0" /></a>
with the existing playlist instead of a single file, then as the user makes selections, call something like this (this is for adding a preroll, poor example, but all I have right now): bc.. <a href="#" onclick="*popup.*addItem({author:'Jeroen', title:'Video Ad', file:'video.flv', category:'preroll', link:'http://my.domain.com'}, 0); return false;">Add Preroll Before Track 1 [0]</a>
and it will add to the playlist in the popup instead of on the main page.
You can see a demo of the methods here: [url=http://willswonders.myip.org:8085/php/basic_popup.html]Basic Popup[/url]
I'm doing some other stuff with that page, so the green buttons are for you, although you are free to click on the other stuff (thumbnails and displayarea) also. :)
please see the - *http://www.jeroenwijering.com/?item=Javascript_API_Examples* for examples like this popupwindow - *http://home5.inet.tele.dk/nyboe/flash/mediaplayer4/JW_API_xmpl_7-3-0-0.html*
please note that the above examples all use the swfobject v.2.1 - *http://code.google.com/p/swfobject/* also note that the javascript api only works online on a server for flash security reasons...
I know this comment is way overdue, Silly Rabbits, but thanks for this simple code! It worked perfectly for me and was exactly the solution I was looking for.
I tried using Silly Rabbits' popup code and it seems to work great. I have two questions about it though -
1) how can I change the popup window title? Right now its just the path for the player file
2) I keep getting an "Access is Denied" error when I close the popup in IE (not in Firefox)? Everything works fine even in IE, the error just comes up when you close the window and you have to hit 'yes' quite a few times for it to go away. Can I suppress the error message somehow since everything seems to be working correctly?
I'm having trouble with the fullscreen function working in the popup code that sillyrabbit posted. when you click on the fullscreen button, nothing happens. Here is an example of the code.
Thank you silly rabbits! It worked for what I need it for aswell. :) But would you be able to amend the code so that the "full screen" button works with the player? Cheers. :)
Just relised "allowfullscreen=true" is actually in that code... unfortunatly it still don't make it work. Oh well... Many thanks for the code though, big help to the headacke I had for a few hours. :D
Thanks Silly Rabbits, that works fine! :) But one thing: The video in the popup seams to laod completely before it starts. This takes some time and is rather annoying. What do I have to do to let it start immediately and load the rest of the video in the background while it is already playing? Does anyone know that piece of code? Thanks a lot in advance!
yes, I do, but its my client's website and I don't think I should post the link here :o
But it definitely just doesn't download progressively but load completely before it starts. There is also no dark-grey progress bar, but only the light grey one and then after a rather long time the black progress bar starts.
As in Silly Rabbits suggestion I haven't defined any bufferlength, do you think this could help?