| | |
Safari Browser Doesn't Play This Video: Why Not?
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2009
Posts: 8
Reputation:
Solved Threads: 0
Ok, I've got this code that needs to load a .wmv file - the client is adamant about using .wmv files and not Flash files - and the client insists that it use variables for the width and height parameters. Thanks to a couple of you, I've now got the code working correctly in IE (it's always worked in Firefox) but I've just noticed that it's not working in Safari. I'm sure it's got something to do with the <object> but am not sure how to fix it.
I've tried including the safari object code for wmv files and then using an if/else statement to only load the object code for safari but my javascript skills aren't that great.
Can anyone help me figure out what's wrong with the code that it's not showing up in Safari?
Here's the code:
As it stands right now, both Firefox and IE try to load the quicktime object after they load the wmv movie object and I'm sure it's because I've coded incorrectly. Any help you can give is greatly appreciated.
Thank you,
M.
I've tried including the safari object code for wmv files and then using an if/else statement to only load the object code for safari but my javascript skills aren't that great.
Can anyone help me figure out what's wrong with the code that it's not showing up in Safari?
Here's the code:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<html> <head> <style type="text/css"> <!-- .fontStyle { font-family: Verdana, Geneva, sans-serif; font-size: small; font-weight: bold; color: #67A2DC; } --> </style> <script type="text/javascript"> window.onload=function(){ loadVideo(); } function loadVideo() { if (parseInt(navigator.appVersion)>3) { if (navigator.appName == "Netscape") { winW = window.innerWidth; winH = window.innerHeight; } if (navigator.appName.indexOf("Microsoft") != -1) { winW = document.body.offsetWidth; winH = document.body.offsetHeight; } } var dimW = winW-50; var dimH = winH-20; var w1 = dimW.toString(); var h1 = dimH.toString(); if(document.getElementById("vidEmbed") != null) { document.getElementById("vidEmbed").src = "Welcome_1.wmv"; document.getElementById("vidEmbed").style.width = w1; document.getElementById("vidEmbed").style.height = h1; } else if(document.getElementById("Player") != null) { document.getElementById("Player").style.width = w1; document.getElementById("Player").style.height = h1; //document.getElementById("objectSrc").value = "oracleWelcome_1.wmv"; document.getElementById("Player").url = "Welcome_1.wmv"; } else if(document.getElementById("quickTime") != null) { document.getElementById("quickTime").style.width = w1; document.getElementById("quickTime").style.height = h1; document.getElementById("qTime").value = "oracleWelcome_1.wmv"; } } </script> </head> <body><div> <p><span class="fontStyle">Introduction<br> </span> <object id="Player" width="100%" height="100%" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" style="border:0px;"> <param name="autoStart" value="True"> <param name="uiMode" value="full"> <param name="volume" value="50"> <param name="mute" value="false"> <embed src="" id="vidEmbed" width="100%" height="100%" autostart="true" uimode="full" volume="50" mute="false"> </embed> </object> <!-- Safari Code --> <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" id="quickTime" width="100%" height="100%" codebase="http://www.apple.com/qtactivex/qtplugin.cab"><param name="src" id="qTime" value=""><param name="autoplay" value="true"><param name="controller" value="false"><embed src="" id="qTime" width="100%" height="100%" autoplay="true" controller="false" pluginspage="http://www.apple.com/quicktime/download/"></embed></object> <!-- End Safari Code --> </p> </div> </body> </html>
As it stands right now, both Firefox and IE try to load the quicktime object after they load the wmv movie object and I'm sure it's because I've coded incorrectly. Any help you can give is greatly appreciated.
Thank you,
M.
That's because you are embedding QT instead of WMP!
Might work
<html>
<head>
<style type="text/css">
<!--
.fontStyle {
font-family: Verdana, Geneva, sans-serif;
font-size: small;
font-weight: bold;
color: #67A2DC;
}
-->
</style>
<script type="text/javascript">
window.onload=function(){
loadVideo();
}
function loadVideo()
{
if (parseInt(navigator.appVersion)>3)
{
if (navigator.appName == "Netscape")
{
winW = window.innerWidth;
winH = window.innerHeight;
}
if (navigator.appName.indexOf("Microsoft") != -1)
{
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
}
var dimW = winW-50;
var dimH = winH-20;
var w1 = dimW.toString();
var h1 = dimH.toString();
if(document.getElementById("vidEmbed") != null)
{
document.getElementById("vidEmbed").src = "Welcome_1.wmv";
document.getElementById("vidEmbed").style.width = w1;
document.getElementById("vidEmbed").style.height = h1;
}
else if(document.getElementById("Player") != null)
{
document.getElementById("Player").style.width = w1;
document.getElementById("Player").style.height = h1;
document.getElementById("Player").url = "Welcome_1.wmv";
}
else if(document.getElementById("quickTime") != null)
{
document.getElementById("quickTime").style.width = w1;
document.getElementById("quickTime").style.height = h1;
document.getElementById("qTime").value = "oracleWelcome_1.wmv";
}
}
</script>
</head>
<body><div>
<p><span class="fontStyle">Introduction<br>
</span>
<object id="Player" width="100%" height="100%" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" style="border:0px;">
<param name="autoStart" value="True">
<param name="uiMode" value="full">
<param name="volume" value="50">
<param name="mute" value="false">
<!-- <embed src="" id="vidEmbed" width="100%" height="100%" autostart="true" uimode="full" volume="50" mute="false"></embed> -->
<embed type="application/x-mplayer2" src="" id="vidEmbed" width="100%" height="100%" autostart="true" uimode="full" volume="50"> </embed>
</object>
<!-- Safari Code -->
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" id="quickTime" width="100%" height="100%" codebase="http://www.apple.com/qtactivex/qtplugin.cab"><param name="src" id="qTime" value=""><param name="autoplay" value="true"><param name="controller" value="false"><embed src="" id="qTime" width="100%" height="100%" autoplay="true" controller="false" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>
<!-- End Safari Code -->
</p>
</div>
</body>
</html> Something is wrong with your Safari [although I don't have it here] because your previous code [the one working on FX and IE] should have worked in Safari too, 'cause this code is trying to use windows media player v.6.4 edition. But as I've already mentioned safari will also need its WMP plug-in installed same as FX, which already has it.
•
•
Join Date: Sep 2009
Posts: 8
Reputation:
Solved Threads: 0
•
•
•
•
Something is wrong with your Safari [although I don't have it here] because your previous code [the one working on FX and IE] should have worked in Safari too, 'cause this code is trying to use windows media player v.6.4 edition. But as I've already mentioned safari will also need its WMP plug-in installed same as FX, which already has it.
Thank you
![]() |
Similar Threads
- Play video/flash over the desktop (C++)
- Flash drives won't play video files on 8GB & 16GB drives, but will play on 2GB drives (Storage)
- How to use asp.net Ajax play video? (JavaScript / DHTML / AJAX)
- Freeze when trying to play video files (Windows NT / 2000 / XP)
- Changing image through JS - Safari Browser (HTML and CSS)
- can't play video games or watch dvd (Windows NT / 2000 / XP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Javascript variable doesnt save enters in IE
- Next Thread: document.getElementById not working in IE. Why?
| Thread Tools | Search this Thread |
addiction advertising ajax apple bbc bittorrent blog british broadband browser browsers business cable censorship china chrome cloudcomputing connectivity conspiticy copyright daniweb development domainname domains download email encryption eu explorer facebook firefox gaming gecko google government holidayshopping html ie7 ie8 iframe intel internet internetexplorer investments iphone isp java javascript jquery linux malware marketing michaelknight microsoft mobile money mozilla music network networking news online opera p2p packet php piracy politics porn privacy public report research retail rss saas safari search security seo sex shopping socialnetworking software speed statistics stocks survey teenagers twitter uk video web webbrowser webmail wifi wiki windows worldwideweb youtube






