Solved

embedded players change on link click

Posted on 2008-10-23
5
1,320 Views
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){
      ob.title=disc[tn];
}

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

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

      if (player=="wm"){
            //WMP.controls.stop();
            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='http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/' showcontrols='1' showstatusbar='0' showdisplay='0' autorewind='0' enablecontextmenu='0' border='0'></embed></object>";

            document.title = "FAMILY JANUSEVI MEDIA";
            return;
      }
if (player=="rp"){
            //RMP.controls.stop();
            PlayerDiv.innerHTML = "<OBJECT ID='RMP' CLASSID='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' WIDTH='400' HEIGHT='300' ><PARAM NAME='SRC' VALUE='http://5fm.com.mk:8011/listen.pls' /><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";
            RMP.SetSource(stream);
            RMP.DoNextEntry();
            RMP.DoPlay();
            return;
      }
      
if (player=="qt"){
            //QTP.controls.stop();
            PlayerDiv.innerHTML = "<object classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' codebase='http://www.apple.com/qtactivex/qtplugin.cab' 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='http://www.apple.com/QuickTime/download/' /><embed src='' width='400' height='300' autoplay='true' controller='true' scale='tofit' pluginspage='http://www.apple.com/QuickTime/download/'></embed></object>";
                                    
            document.title = "FAMILY JANUSEVI MEDIA";
            QTP.src=stream;
            return;
      }
      
      if (player=="swf"){
            //FLV.controls.stop();

      PlayerDiv.innerHTML = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,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='http://www.macromedia.com/go/getflashplayer'</EMBED></OBJECT>";
      
      document.title = "FAMILY JANUSEVI MEDIA";
            return;
      
      }
      
      if (player=="nw"){
            document.title = "Opening New Window (Stream Website) for nw stream in new window";
            window.open(stream);
            return;
      }
}

Here is my web site for reference http://janusevi.tripod.com

Any help appreciated
0
Comment
Question by:dusko66
  • 3
  • 2
5 Comments
 
LVL 75

Expert Comment

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

You need to change

 VALUE='http://5fm.com.mk:8011/listen.pls'

to

 VALUE='"+stream+"'
in the rp code and

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

and

SRC='& url &'

to

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

SRC='"+stream+"'

in the Flash code
0
 
LVL 75

Accepted Solution

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

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

<embed src='' width='400'

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

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

Author Closing Comment

by:dusko66
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
0
 

Author Comment

by:dusko66
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.
Thanks
0
 
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='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,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='http://www.macromedia.com/go/getflashplayer' autoplay='true'></EMBED></OBJECT>";

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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)
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…

919 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

15 Experts available now in Live!

Get 1:1 Help Now