madspof Posted September 19, 2008 Share Posted September 19, 2008 Hi everyone i am trying to find away of having a list of video files with links and once clicked will change what is playing in the JW Player on the same page. Is there a way of doing this ? thanks before hand madspof Quote Link to comment Share on other sites More sharing options...
F1Fan Posted September 19, 2008 Share Posted September 19, 2008 Write a function that changes the source like this: document.getElementById('the id of your player').src = "new video source"; Quote Link to comment Share on other sites More sharing options...
madspof Posted September 19, 2008 Author Share Posted September 19, 2008 I have no knoweldge at all at java so could you give me a hand ? Quote Link to comment Share on other sites More sharing options...
F1Fan Posted September 19, 2008 Share Posted September 19, 2008 Sure thing. However, remember that Java and Javascript are completely different. The only similarity is that they are both programming languages. This could be your javascript: <script type="text/javascript> function changeVideo(newsource){ document.getElementById('video').src = newsource; } </script> Then you need your embedded image (I have no idea what you're using, because you haven't included your code): <embed src="somevideofile.mpg"> Finally, you need something that the user does to call the funciton, like a button (or multiple buttons): <input type="button" value="Click Me!" onclick="changeVideo('someothervideofile.mpg');"> Quote Link to comment Share on other sites More sharing options...
madspof Posted September 19, 2008 Author Share Posted September 19, 2008 ok well ive been stabing in the dark and havnt realy come up with much this is my players code <script type="text/javascript" src="/swfobject.js"></script> <div id="player">This text will be replaced</div> <script type="text/javascript"> var so = new SWFObject('/movie.plv','mpl','470','320','9'); so.addParam('allowscriptaccess','always'); so.addParam('allowfullscreen','true'); so.addParam('flashvars','&file=/flash.flv'); so.write('player'); </script> Do i need to place the script into where they ask for the movie url ? Quote Link to comment Share on other sites More sharing options...
F1Fan Posted September 19, 2008 Share Posted September 19, 2008 Where is your player object? And what is the source or that javascript file? Di you just copy this form somewhere? Quote Link to comment Share on other sites More sharing options...
madspof Posted September 20, 2008 Author Share Posted September 20, 2008 Okay well i am using this script on my site which currently works and play a .flv file. I know need to go about control the flash with javascript in the form of a list on the same page. well here is the code could someone show me please im completly stuck. <div id="container"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> var s1 = new SWFObject("player.swf","ply","328","200","9","#FFFFFF"); s1.addParam("allowfullscreen","true"); s1.addParam("allowscriptaccess","always"); s1.addParam("flashvars","file=videos/CRMV0116.flv&image="); s1.write("container"); </script> Quote Link to comment Share on other sites More sharing options...
Zane Posted September 20, 2008 Share Posted September 20, 2008 follow this concept....don't copy it....it probably won't work function changeVideo(theVideo) { var so = new SWFObject(thevideo,'mpl','470','320','9'); so.addParam('allowscriptaccess','always'); so.addParam('allowfullscreen','true'); so.addParam('flashvars','&file=/flash.flv'); so.write('player'); } List of links Quote Link to comment Share on other sites More sharing options...
dropfaith Posted September 20, 2008 Share Posted September 20, 2008 http://www.jeroenwijering.com/?item=JW_FLV_Media_Player in case people need the support files and such to answer this it seems like this player im not to good with js tho so its all i can help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.