embedded players change on link click

Posted on 2008-10-23
Last Modified: 2013-11-18
On my web page I have an embedded plugin with links in a div. Depending on the media type clicking on the link opens the needed plugin in the same embed. It has windows media, real player, quick time and flash plugin. The problem is with the flash. If I put a link to a flash file the no matter what flash link I select it opens the link to the flash in the code bellow. I need a solution that when I click on a flash link it will play the link in the div in the html.
I think there is a small problem with the real player part too.
Here is the code:

// JavaScript Document

function cDisc(ob,tn){

function mPlay(stream,player){
            var PlayerDiv=document.getElementById("mPlayer");

// document.all.mPlayer.innerHTML = "";

      if (player=="wm"){
            PlayerDiv.innerHTML = "<object classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' type='application/x-mplayer2' width='400' height='300' id='WMP' ><param name='enableContextMenu' value='0'/><param name='autoplay' value='true'/><param name='SendPlayStateChangeEvents' value='true'/><param name='url' value='"+stream+"'/><embed src='"+stream+"' width='400' height='300' autostart='1' autoplay='1' align='middle' type='application/x-mplayer2' pluginspage='' showcontrols='1' showstatusbar='0' showdisplay='0' autorewind='0' enablecontextmenu='0' border='0'></embed></object>";

            document.title = "FAMILY JANUSEVI MEDIA";
if (player=="rp"){
            PlayerDiv.innerHTML = "<OBJECT ID='RMP' CLASSID='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' WIDTH='400' HEIGHT='300' ><PARAM NAME='SRC' VALUE='' /><PARAM NAME='CONSOLE' VALUE='_unique' /><PARAM NAME='CONTROLS' VALUE='ImageWindow,ControlPanel,StatusBar' /><PARAM NAME='CENTER' VALUE='true' /><embed src='' width='400'height='300' console='_unique' controls='ImageWindow,ControlPanel,StatusBar' center='true' name='RMP'></embed></OBJECT>";
            document.title = "FAMILY JANUSEVI MEDIA";
if (player=="qt"){
            PlayerDiv.innerHTML = "<object classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' codebase='' width='400' height='300' id='QTP'><param name='src' value=''/><param name='autoplay' value='true'><param name='CONTROLLER' VALUE='true'><param name='SCALE' VALUE='tofit'><param name='pluginspage' value='' /><embed src='' width='400' height='300' autoplay='true' controller='true' scale='tofit' pluginspage=''></embed></object>";
            document.title = "FAMILY JANUSEVI MEDIA";
      if (player=="swf"){

      PlayerDiv.innerHTML = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'codebase=',0,40,0'WIDTH='400' HEIGHT='300' id='myMovieName'><PARAM NAME='movie' VALUE='& url &'><param name='allowScriptAccess' value='always'><PARAM NAME='quality' VALUE='High'><EMBED SRC='& url &' allowScriptAccess='always'quality=High WIDTH='400' HEIGHT='300'NAME='myMovieName' TYPE='application/x-shockwave-flash'PLUGINSPAGE=''</EMBED></OBJECT>";
      document.title = "FAMILY JANUSEVI MEDIA";
      if (player=="nw"){
            document.title = "Opening New Window (Stream Website) for nw stream in new window";

Here is my web site for reference

Any help appreciated
Question by:dusko66
  • 3
  • 2
LVL 75

Expert Comment

by:Michel Plungjan
ID: 22801891
You only use +stream+ in the MediaPlayer

You need to change



in the rp code and

<PARAM NAME='movie' VALUE='& url &'>


SRC='& url &'


<PARAM NAME='movie' VALUE='"+stream+"'>


in the Flash code
LVL 75

Accepted Solution

Michel Plungjan earned 140 total points
ID: 22801894
in the qt you need to change

<param name='src' value=''/>

<embed src='' width='400'

<param name='src' value='"+stream+"'/>

<embed src='"+stream+"' width='400'

Author Closing Comment

ID: 31509498
I would really want to thank you. I have been searching for an answer for about 10 days. It means a lot to me.
Much appreciated

Author Comment

ID: 22803909
Hi mplungjan
I have a related question.
I am trying to make the flash movie to autostart.
<PARAM NAME='movie' VALUE='"+stream+"&autoplay=1'>
<EMBED SRC='"+stream+"&autoplay=1'
also tried
<PARAM NAME='movie' VALUE='"+stream+"&autoplay=1'>
<EMBED SRC='"+stream+"&autoplay=1'
I tried also true for the 1 with no luck.
I feel I am very close.
Can you help on this one.
LVL 75

Expert Comment

by:Michel Plungjan
ID: 22804035
Yes, you are mixing the name of the file into the options for the plugin


 PlayerDiv.innerHTML = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'codebase=',0,40,0'WIDTH='400' HEIGHT='300' id='myMovieName'><PARAM NAME='movie' VALUE='"+stream+"'><param name='allowScriptAccess' value='always'><PARAM NAME='quality' VALUE='High'>

<PARAM NAME='autoplay' VALUE='true'><EMBED SRC='"+stream+"' allowScriptAccess='always'quality=High WIDTH='400' HEIGHT='300'NAME='myMovieName' TYPE='application/x-shockwave-flash'PLUGINSPAGE='' autoplay='true'></EMBED></OBJECT>";

Open in new window


Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now