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


Groups > comp.lang.javascript > #26642

Re: test for autoplay

From "Christoph M. Becker" <cmbecker69@arcor.de>
Newsgroups comp.lang.javascript
Subject Re: test for autoplay
Date 2015-01-21 23:35 +0100
Organization solani.org
Message-ID <m9p9im$dhi$1@solani.org> (permalink)
References <ttCdnYD1iYEQjl3JnZ2dnUVZ8v-dnZ2d@westnet.com.au> <2227075.ZdhQdnHKJ3@PointedEars.de>

Show all headers | View raw


Thomas 'PointedEars' Lahn wrote:

> Andrew Poulos wrote:
> 
>>      $(audio).on('play', function() {
>>        AUTOPLAY = true;
>>      });
>>
>> Alas I don't understand "$(audio).on('play', function() {"
>>
>> What is it doing?
> 
> This is the jQuery way of adding an event listener for the “play” event to 
> the element referred to by “audio”.  Apparently the standards-compliant
> 
>   audio.onplay = function () {
>     AUTOPLAY = true;
>   };
> 
> was too hard for them :->

I had only found the onplay property of the MediaController
interface[1], but have not been able to verify that the HTMLAudioElement
interface is supposed to inherit MediaController.  Where is that specified?

> This code creates an “audio” element in memory (using a proprietary 
> approach; the standards-compliant approach would be 
> “document.createElement("audio")”) 

It seems to me the Audio constructor is specified in the W3C HTML5
Recommendation.[2]

[1]
<http://www.w3.org/TR/html5/embedded-content-0.html#handler-mediacontroller-onplay>
[2] <http://www.w3.org/TR/html5/embedded-content-0.html#dom-audio>

-- 
Christoph M. Becker

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

test for autoplay Andrew Poulos <ap_prog@hotmail.com> - 2015-01-22 07:55 +1100
  Re: test for autoplay Scott Sauyet <scott.sauyet@gmail.com> - 2015-01-21 13:17 -0800
    Re: test for autoplay Andrew Poulos <ap_prog@hotmail.com> - 2015-01-22 08:42 +1100
  Re: test for autoplay Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-01-21 23:03 +0100
    Re: test for autoplay "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-01-21 23:35 +0100
      Re: test for autoplay Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-01-22 01:10 +0100
        Re: test for autoplay "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-01-22 14:14 +0100

csiph-web