LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Safari: Not the Error Message I Want (https://www.linuxquestions.org/questions/programming-9/safari-not-the-error-message-i-want-779827/)

CoderMan 01-04-2010 07:28 PM

Safari: Not the Error Message I Want
 
Hi, I've got some code in an HTML page like so:

Code:

<video src="http://robots.arsc.edu/video/boe-bot-emptiness.ogv" controls>
<b>There is supposed to be a video here, but your browser does not support the Ogg Vorbis video format. These videos can be viewed natively from within the Firefox web browser, versions 3.5 and greater.</b>
</video>

This displays the OGV video natively in Firefox just fine, like it is supposed to do. In other browsers it is supposed to just display the error message contained inside the bold tags. The error message displays correctly in Internet Explorer, but when I open the page in Safari, instead of the error message Safari displays a frozen, empty video box.

What would be the simplest solution to this? I'm okay with the video only being viewable in Firefox, but I don't want people visiting with Safari to think that the videos are simply broken.

smeezekitty 01-04-2010 07:36 PM

Why don't you convert to a format most browsers support, like windows AVI (i know. i know)
I have never even heard of ogv but AVI is supported in FF, IE and probably safari.

CoderMan 01-05-2010 12:51 AM

Quote:

Originally Posted by smeezekitty (Post 3814179)
Why don't you convert to a format most browsers support, like windows AVI (i know. i know)
I have never even heard of ogv but AVI is supported in FF, IE and probably safari.

Thank you for your suggestion, but in the future please do not use up the zero-reply status of my post unless you have an answer to the question I asked.

I use Ogg Theora because it is my small way of promoting freedom. Mozilla had the courage to support it, and by giving it native support in a popular, cross-platform browser, they made it practically possible for a truly open, patent-free video compression format to be exposed to millions of people. But that doesn't make much difference if none of us developers actually use it.

I don't always have the freedom to support my ideals as I would like, but this time I do.

smeezekitty 01-05-2010 01:17 AM

Code:

<script language="javascript”>
if (navagator.appName==”Safari”) //Or was it apple Safari?
{
document.write(’Sorry, the video is not supported on your browser’)
}
else {
document.write('<video src="http://robots.arsc.edu/video/boe-bot-emptiness.ogv" controls>
<b>There is supposed to be a video here, but your browser does not support the Ogg Vorbis video format. These videos can be viewed natively from within the Firefox web browser, versions 3.5 and greater.</b>
</video>');
}
</script>


CoderMan 01-11-2010 08:33 PM

Quote:

Originally Posted by smeezekitty (Post 3814472)
Code:

<script language="javascript”>
if (navagator.appName==”Safari”) //Or was it apple Safari?
{
document.write(’Sorry, the video is not supported on your browser’)
}
else {
document.write('<video src="http://robots.arsc.edu/video/boe-bot-emptiness.ogv" controls>
<b>There is supposed to be a video here, but your browser does not support the Ogg Vorbis video format. These videos can be viewed natively from within the Firefox web browser, versions 3.5 and greater.</b>
</video>');
}
</script>


Thanks. Correct me if I'm wrong, though: a consequence of the fix is that if the user has javascript turned off, nothing will display at all. (Not even an error message.)


All times are GMT -5. The time now is 07:50 PM.