Status
Not open for further replies.

Keosoft90

Active Member
349
2010
87
65
hi all,
i have plan to create streaming site. All is Ok but when I want load video link to player , i dont know how to do it (reason : i'm noob of javascript)
here is My Embed Player :
PHP:
<div id="usplayer">
	<object id="jwplayer786" classid="jwplayer0786" width="590" height="300" bgcolor="#000000">
	<param name="movie" value="player.swf" />
	<param name="allowFullScreen" value="true" />
	<param name="allowScriptAccess" value="always" />
	<param name="FlashVars" value="$link_will_load" />
	<embed name="jwplayer786" src="player.swf"  flashvars="$link_will_load" type="application/x-shockwave-flash"  allowfullscreen="true" allowscriptaccess="always" width="590"  height="300" bgcolor="#000000" />
	</object>
</div>
Here is my link to load to player, i want to click to 1 link , it will load to player and play.
PHP:
<div class="links">
<a href="">Link1</a>, <a href="">Link2</a>,<a href="">Link3</a>,...
<a href="">Linkn</a>
</div>
it is html page so i think javascript can do it, but i dont know how to do that .
Hope anyone can help me.
Thanks All For Reading.<3
 
4 comments
Or you can use the simple HTML5 code


Code:
<video width="320" height="240" controls="controls">
  <source src="movie.mp4" type="video/mp4" />
  <source src="movie.ogg" type="video/ogg" />
  Your browser does not support the video tag.
	</video>
 
You can delete the div "usplayer" content and rewrite the embedding code with new link, with jQuery it's very easy:

PHP:
$(".links a").click(function(){
embed = $('<object id="jwplayer786" class....>....<param name="FlashVars" value="'+$(this).href()+'" />'); //the same embedding code with just changin the FlashVars value with the clicked link...
$("#usplayer").html(embed);
return false; //to stop the a click event
});
 
Status
Not open for further replies.
Back
Top