SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2009
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    html5 audio controls

    i'm wondering how you can override the controls of the html5 audio tag, without using a 3rd party script? i dont like how enabling the controls will lead to 6 different designs for the various browsers.

  2. #2
    SitePoint Addict sdleihssirhc's Avatar
    Join Date
    Feb 2009
    Posts
    387
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    What do you mean by "without using 3rd party script"? In order to have the controls show up, you have to explicitly tell the browser to do so...

    HTML Code:
    <audio controls />
    ...so if you don't want those disparate controls showing up, don't set the "controls" attribute.

    But if you want to then put your own controls in there, controls that are the same in every browser, you'll have to use JavaScript. And if you don't want to use 3rd party scripts, you'll have to build the JS yourself.

    Are you sure you don't want to use something like audio.js? You'll save yourself a lot of headaches.
    I'm the web overlord for Graphic Business Systems

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2009
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sdleihssirhc View Post
    What do you mean by "without using 3rd party script"? In order to have the controls show up, you have to explicitly tell the browser to do so...

    HTML Code:
    <audio controls />
    ...so if you don't want those disparate controls showing up, don't set the "controls" attribute.

    But if you want to then put your own controls in there, controls that are the same in every browser, you'll have to use JavaScript. And if you don't want to use 3rd party scripts, you'll have to build the JS yourself.

    Are you sure you don't want to use something like audio.js? You'll save yourself a lot of headaches.
    thanks this is helpful. by third party i meant something like jplayer or the cool one you linked to (never saw that before).

    i am kind of curious about what kind of javascript is involved though. skinning some players can be a lot of work, and i just wondered if making it yourself can save that headache.

  4. #4
    SitePoint Addict sdleihssirhc's Avatar
    Join Date
    Feb 2009
    Posts
    387
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    In my opinion, it's not worth it, because there are so many different bugs and edge cases you'd have to allow for.

    Also, if you choose a good HTML-based <audio> player (such as, ahem, audio.js), you can style the player however you'd like just using simple CSS.
    I'm the web overlord for Graphic Business Systems


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •