views:

445

answers:

2

I have an Embed object that shows a video stream, how to setup a html link to it, so when user clicks on the link, it will open another window to show the video ?

<embed id="player" src="http://media2.wtnh.com/_local/livestreams/FMLPlayer.swf" align="center" width="588" height="351" wmode="opaque" allowfullscreen="true" flashvars="live=true&megastream=rtmpe://megastream.uvault.com/lbservice/&uniqueId=d733607a4ce559&shuffle=false&displayheight=425&autostart=true&frontcolor=0xFFFFFF&backcolor=0x000000&lightcolor=0xCCCCFF&overstretch=true&showicons=false&showvolume=false&volume=0&showdigits=false&showicons=false&showvolume=false&repeat=list"></embed>

Here's my html file :

<Html>
<Head><Title>TV Channels</Title></Head>

<Body BgColor=#D6D6D6 Link=#FFFFFF Vlink=#00FFFF>

<Center>

      <Table Cellspacing=0 Cellpadding=0>
        <Tr><Td Align=Center Valign=Bottom BgColor=#3366FF><A Href="" target="_blank"><Font Size=2 Color=white>AlJazeeraEnglish</Font></A></Td></Tr>
        <Tr>
          <Td>
            <Object Width=588 Height=351>
              <embed id="player" src="http://freetubetv.net/media/ftbe.swf" align="center" width="588" height="351" wmode="opaque" allowfullscreen="true" flashvars="image=http://i.imagehost.org/0103/aljazeera.gif&amp;file=livestation/aljazeer_en_medium.sdp&amp;streamer=rtmp://liveplay.simplecdn.net/aljazeerenhqf800/&amp;displayheight=425&amp;shuffle=true&amp;autostart=true&amp;overstretch=true&amp;showicons=false&amp;showvolume=false&amp;volume=0&amp;showdigits=false&amp;showicons=false&amp;showvolume=false&amp;repeat=list&amp;displayclick=fullscreen&amp;controlbar=none&amp;icons=false"&gt;&lt;/embed&gt;
            </Object>
          </Td>
        </Tr>
      </Table>

</Center>
</Body>
</Html>

Right now if you click on the title "AlJazeeraEnglish" it opens an empty window, how to display the Embeded video feed in that empty window ? I know one way is to save the <embed>...</embed> string into another html file, and link to that file. But I don't want to save it to another file, I wonder if I can pass the string to the link somehow, such as : <A Href="<embed>...</embed>" target="_blank"> ?

+1  A: 

Create another page that all it has in the body is that embedded video. Create an anchor tag to that page. Profit.

Edit:

You cannot do it as you are wishing. If you have server side processing, or you want to do cheesy javascript, you can change the look of the same page by adding query parameters as part of the link and changing the size of your embed tag to fill the page, based on those parameters. This is not recommended though.

The recommended way is a new html page. If your worry is duplicating code between the two pages, you can encapsulating the embed tag into a javascript file and dynamically add it where you need it on each of the pages, or use some sort of preprocessor to join pages much as Dreamweaver does.

Edit 2:

var params = window.location.search.substring(1);
var splitParams = params.split('&');

var targetKey = "fullscreen";
var targetValue = null;

var keys = new Array();
var values = new Array();

for (i = 0; i < splitParams.length; i++) {
    var keyValue = splitParams[i].split('=');

    keys.push(keyValue[0]);
    values.push(keyValue[1]);
}

for (i = 0; i < keys.length; i++) {
    if (keys[i] == targetKey) {
        targetValue = values[i];
        break;
    }
}

if (targetValue != null) {
    // Do something different with your embed object
} else {
    // Do what you're doing now with your embed object
}
Myles
Any sample code for using javascript to achieve this ?
Frank
Interesting... But I'm not very familiar with javascript, how do I plugin your sample code into my html ? I guess it needs to go to the <Head> part of it ? And what would the link look like ? Thanks !
Frank
A: 

Go to this site and see how links are display and connected to open a new windows of another website: OFM-TV Europe

TK