multiple plug-in vlc for web page

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
sir raden

multiple plug-in vlc for web page

Postby sir raden » 21 Jul 2006 05:40

Hi all..

I have a problem, web browser that used 2 client is IE and Firefox. I have try build a web page (just one page) that can be used for IE or Firefox browser for recieve a stream file.
When client use firefox audio and video is out clearly but if client use IE no video just audio.

Please anybody in this forum help me to correct the script

This is a script test.html :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<title>TV Streaming</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="image_files/lib.css" rel="stylesheet" type="text/css">

<style type="text/css">

<!--


body {

background-color: #B7BCC3;

}

--></style>

</head>

<body>

<table width="320" border="0" align="center" cellpadding="0" cellspacing="1"

ID="Table1">

<tr>

<td height="240" width="100%" bgcolor="#FFFFFF" align="center">

<span id="embededObj"></span>

</td>

</tr>

<tr>

<td><div align="center" class="btn2ad">

<input type="button" onclick="videoPlay();" value="Play" ID="Button1" NAME="Button1">

<input type="button" onclick="videoStop();" value="Stop" ID="Button2" NAME="Button2">

</div>

</td>

</tr>

</table>

<script language="javascript" type="text/javascript">

function videoPlay() {

var _video = document.getElementById('video0');

_video.play();

}

function videoStop() {

var _video = document.getElementById('video0');

_video.stop();

}



function _lib2bwcheck()

{

this.ver=navigator.appVersion;

this.agent=navigator.userAgent;

this.dom=document.getElementById?1:0;

this.opera = window.opera?1:0;

this.operaver = (this.opera? this.agent.substr(this.agent.indexOf("Opera")+6, 4) : 0);

this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera)?1:0;

this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera)?1:0;

this.ie4=(document.all && !this.dom && !this.opera)?1:0;

this.ie=this.ie4||this.ie5||this.ie6;

this.iever=(this.ie? this.ver.substr(this.ver.indexOf("MSIE ")+5, 3) : 0);

this.mozilla=(this.agent.indexOf("Gecko")>-1)?1:0;

this.mozrev=(this.mozilla? this.agent.substr(this.agent.indexOf("rv:")+3, 3) : 0);

this.mac=this.agent.indexOf("Mac")>-1;

this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;

this.ns4=(document.layers && !this.dom)?1:0;

this.bw=(this.ie || this.ns4 || this.ns6 || this.opera);

return this;

}

var _bw=new _lib2bwcheck();

// capture object

var _embededObj = document.getElementById('embededObj');

if (_bw.mozilla) {

// for Gecko base browser including Mozilla & Mozilla Firefox

_embededObj.innerHTML = '<embed type="application/x-vlc-plugin" id="video0" name="video0" loop="True" autostart="True" width="320" height="240" target="http://@10.31.12.156/mov/klip.mpg" \/>';

}

if (_bw.ns6) {

// for netscape 6

}

if (_bw.ns4) {

// for netscape 4

}

if ((_bw.ie6) && (!window.opera)) {

// for IE 6

_embededObj.innerHTML = '<OBJECT classid="clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8" codebase="/axvlc.cab" width="320" height="240" id="video0" events="True" VIEWASTEXT><param name="Src" value="http://@10.31.12.156/mov/KLIP.MPG"/><param name="ShowDisplay" value="True" \/><param name="AutoLoop" value="True" \/><param name="AutoPlay" value="True" \/><\/OBJECT>';

}

if ((_bw.ie5) && (!window.opera)) {

// for IE 5

}

if ((_bw.ie4) && (!window.opera)) {

// for IE 4

}

if (_bw.opera) {

// for Opera

}

</script>

</body>

</html>

Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 40 guests