[GRLUG] audio tags

Roger Roelofs roger.roelofs at gmail.com
Fri Nov 18 13:02:16 EST 2011


Bob,

First, stop depending on w3schools for accurate information.
<http://w3fools.com/>  In this case you got lucky and their example
was correct.

Second, the doctype is important because browsers use it ti try to
figure out f you know what you are doing.  That doctype is know to
keep browsers in standards mode even if they don't know about htm5.
If your doctype convinces the browser to switch to compatibility mode
your html5 tags won't work well.  Html5 is en extension to html and so
needs to work in older browsers as much as possible.

On Fri, Nov 18, 2011 at 12:53 PM, Bob Kline <bob.kline at gmail.com> wrote:
> According to http://www.w3schools.com/html5/tag_doctype.asp
> there is no html5 declaration using "html5".
> It's example is:
>
> Example
>
> The <!DOCTYPE> declaration for HTML5:
>
> <!DOCTYPE html>
> <html>
> <head>
> <title>Title of the document</title>
> </head>
>
> <body>
> The content of the document......
> </body>
>
> </html>
> Of course browsers tend to silently
> ignore tags and options that aren't
> valid, so if you replaced "html" above
> with "html5", you'd think you were on
> your way.
> Does it seem at all strange that
> "DOCTYPE hmtl" implies html5?
> Without it, any html5 tags would be
> ignored of course, but why not "html5?"
>    -- Bob
>
>
> On Thu, Nov 17, 2011 at 4:43 PM, Topher <topher at codeventure.net> wrote:
>>
>> On 11/17/2011 04:27 PM, Bob Kline wrote:
>> > <!DOCTYPE html5>
>> > <body>
>> > <audio controls="controls">
>> > <source src="kk.mp3" type="audio/mp3" />
>> > Your browser does not support the audio tag.
>> > </audio>
>> > </body>
>> > </html5>
>> >
>> >
>> > The file is called xx.html5
>>
>> I'm assuming your web server knows how to deal with .html5 files.
>>
>> In your code sample above there's no <head></head>, and there's no
>> <html></html>.  This would cause the file to not be valid html, and
>> could easily make the browser freak out.  Here's the proper code:
>>
>>
>> <!DOCTYPE html5>
>> <html>
>>        <head>
>>                <title>Bob's awesome audio</title>
>>        </head>
>>        <body>
>>                <audio controls="controls">
>>                        <source src="kk.mp3" type="audio/mp3" />
>>                        Your browser does not support the audio tag.
>>                </audio>
>>        </body>
>> </html>
>>
>> Indenting is not necessary, I just did it for clarity.
>>
>> Keep in mind that Firefox won't play mp3's and I don't think IE will
>> play ogg.  That's why they made it possible, and suggest, that you put
>> source tags for both audio formats.  The browser plays the one it can.
>>
>> All that said, you might want to check out http://mediaelementjs.com/
>>
>> It's a small javascript app that detects browsers nicely and makes an
>> html5 player with the proper file format and falls back to flash when
>> the browser can't do html5.
>>
>> --
>> This message has been scanned for viruses and
>> dangerous content by MailScanner, and is
>> believed to be clean.
>>
>> _______________________________________________
>> grlug mailing list
>> grlug at grlug.org
>> http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> _______________________________________________
> grlug mailing list
> grlug at grlug.org
> http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug
>



-- 
Roger

Roger Roelofs
Know what you value.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the grlug mailing list