locked
How to change the default color of the audio tag track?

    Question

  • Hi,

    In my application, I use the <audio> tag with the "controls" options and it works well. But the default track is purple and I would like to change it to a color that match my theme. I tried a few CSS properties but none will change it. And I can't inspect the element with the DOM Explorer because the <audio> tag cannot be "exploded"

    What is the CSS property to change the track color? A user pointed out that in XAML, you can override this kind of value, using the SliderTrackDecreaseBackgroundThemeBrush property

    Thanks for your help!

    Fabien

    Thursday, November 14, 2013 6:55 PM

Answers

  • Hi Fabien,

    Sorry, <Audio> in WinJS is an HTML5 control and currently there is no way to style by using CSS. Instead if you need a custom styled audio player, you could implement it by writing JavaScript code, or use some 3rd party library.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, November 15, 2013 6:47 AM
    Moderator

All replies

  • Hi Fabien,

    Sorry, <Audio> in WinJS is an HTML5 control and currently there is no way to style by using CSS. Instead if you need a custom styled audio player, you could implement it by writing JavaScript code, or use some 3rd party library.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, November 15, 2013 6:47 AM
    Moderator
  • Hello,

    Thanks for your answer, just wanted to be sure 

    Fabien

    Friday, November 15, 2013 10:35 AM