0

I want a javascript code to know whether our browser has Mp3,audio encoding,video encoding and Printing capability or not.For example if i will click a button on 1st page on the next page i want to see the output like

Mp3 Capable:True/False Audio Encoding Capabilty: True/False Video Encoding Capability: True/False Printing Capabilty: True/False

1 Answers1

2

I suggest using Modernizer for feature detection, but if this is not suitable for your case you can test either User Agent (each one supports different audio/video formats) or test for mpeg support (for audio) with this JS code:

function isMpegSupported(){
   var elem = document.createElement('audio');
   return !!(elem.canPlayType && elem.canPlayType('audio/mpeg;') !== '');
}

(Code inspired by this question)

I also suggest reading about the method canPlayType and about feature detection, this is a good place to start (also has great info about video format feature detection)

Community
  • 1
  • 1
Lior
  • 1,599
  • 17
  • 21
  • @user1613252 did this answer not resolve your question, or at least help? – Lior Jan 07 '13 at 09:11
  • @user1613252 if my answer did solve your issue can you please mark it as so, else comment and I'll try to help further. Thanks. – Lior Feb 13 '13 at 10:49