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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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 invoke it on a web page. 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.: (CODE)

695 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