Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #13540 > unrolled thread

video

Started byAndrew Poulos <ap_prog@hotmail.com>
First post2012-04-23 20:32 +1000
Last post2012-04-24 08:17 -0700
Articles 5 — 3 participants

Back to article view | Back to comp.lang.javascript


Contents

  video Andrew Poulos <ap_prog@hotmail.com> - 2012-04-23 20:32 +1000
    Re: video Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-04-23 13:13 +0200
      Re: video Andrew Poulos <ap_prog@hotmail.com> - 2012-04-23 22:06 +1000
        Re: video Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-04-23 15:09 +0200
    Re: video Bart Van der Donck <bart@nijlen.com> - 2012-04-24 08:17 -0700

#13540 — video

FromAndrew Poulos <ap_prog@hotmail.com>
Date2012-04-23 20:32 +1000
Subjectvideo
Message-ID<Wf-dnZS2OJZdsgjSnZ2dnUVZ_tWdnZ2d@westnet.com.au>
A client has a MP4 video they want to play in a browser. I wrote some 
HTML that user the QuickTime player to play the video. The client is 
using a "modern" browser which apparently has support for MP4 built-in 
so they don't want the browser to suggest downloading the QT player.

I found this

<http://developer.practicalecommerce.com/articles/1697--Video-for-Everybody-Gracefully-Degrades>

but to me the HTML is jarring.

Is this

function supports_video() {
   return !!document.createElement('video').canPlayType;
}

from

<http://fortuito.us/diveintohtml5/detect.html#video-formats>

a valid way test for support for the video format?

Andrew Poulos

[toc] | [next] | [standalone]


#13541

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-04-23 13:13 +0200
Message-ID<1400436.AFRqVoOGUt@PointedEars.de>
In reply to#13540
Andrew Poulos wrote:

> A client has a MP4 video they want to play in a browser. […]
> Is this
> 
> function supports_video() {
>    return !!document.createElement('video').canPlayType;
> }
> 
> from
> 
> <http://fortuito.us/diveintohtml5/detect.html#video-formats>
> 
> a valid way test for support for the video format?

No.


PointedEars
-- 
var bugRiddenCrashPronePieceOfJunk = (
    navigator.userAgent.indexOf('MSIE 5') != -1
    && navigator.userAgent.indexOf('Mac') != -1
)  // Plone, register_function.js:16

[toc] | [prev] | [next] | [standalone]


#13545

FromAndrew Poulos <ap_prog@hotmail.com>
Date2012-04-23 22:06 +1000
Message-ID<Bb6dnWfVU5xW2AjSnZ2dnUVZ_qydnZ2d@westnet.com.au>
In reply to#13541
On 23/04/2012 9:13 PM, Thomas 'PointedEars' Lahn wrote:
> Andrew Poulos wrote:
>
>> A client has a MP4 video they want to play in a browser. […]
>> Is this
>>
>> function supports_video() {
>>     return !!document.createElement('video').canPlayType;
>> }
>>
>> from
>>
>> <http://fortuito.us/diveintohtml5/detect.html#video-formats>
>>
>> a valid way test for support for the video format?
>
> No.

Oops, I meant, testing for support of the video element.

Andrew Poulos

[toc] | [prev] | [next] | [standalone]


#13547

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-04-23 15:09 +0200
Message-ID<5545457.NJFYEL58v4@PointedEars.de>
In reply to#13545
Andrew Poulos wrote:

> On 23/04/2012 9:13 PM, Thomas 'PointedEars' Lahn wrote:
>> Andrew Poulos wrote:
>>> A client has a MP4 video they want to play in a browser. […]
>>> Is this
>>>
>>> function supports_video() {
>>>     return !!document.createElement('video').canPlayType;
>>> }
>>>
>>> from
>>>
>>> <http://fortuito.us/diveintohtml5/detect.html#video-formats>
>>>
>>> a valid way test for support for the video format?
>> No.
> 
> Oops, I meant, testing for support of the video element.

I have nothing to add at this time.


PointedEars
-- 
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
  -- Richard Cornford, cljs, <cife6q$253$1$8300dec7@news.demon.co.uk> (2004)

[toc] | [prev] | [next] | [standalone]


#13564

FromBart Van der Donck <bart@nijlen.com>
Date2012-04-24 08:17 -0700
Message-ID<122c635f-1e1b-4dc1-8c75-7f4ad8090dbb@c4g2000yqj.googlegroups.com>
In reply to#13540
Andrew Poulos wrote:

> A client has a MP4 video they want to play in a browser. I wrote some
> HTML that user the QuickTime player to play the video. The client is
> using a "modern" browser which apparently has support for MP4 built-in
> so they don't want the browser to suggest downloading the QT player.
>
> I found this
> http://developer.practicalecommerce.com/articles/1697--Video-for-Ever...
> but to me the HTML is jarring.
>
> Is this
>
> function supports_video() {
>    return !!document.createElement('video').canPlayType;
> }
>
> from
>
> <http://fortuito.us/diveintohtml5/detect.html#video-formats>
>
> a valid way test for support for the video format?

I think 'canPlayType()' is your only real chance, but the technology
doesn't look very solid:
1. html5 and recent js syntax
2. may return values like 'probably' or 'maybe'

As written, your code won't check much, because 'canPlayType()' is
without arguments.

I found the following article quite useful:
http://www.w3schools.com/html5/av_met_canplaytype.asp

Video formats are still poorly standardized. At this moment I would
advise to put them on YouTube.

Hope this helps,

--
 Bart

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web