简体   繁体   中英

HTML5 Player replacing Windows Media Player Plugin

After researching many topics and different fourms I feel at a loss. I understand the answer may be simple but i'm just not seeing it. So without further ado here is what i have going on.

I have a locally hosted webpage that currently if loaded in Internet Explorer plays audio files (WAV format) through Windows Media Player Plugin. Being that Internet Explorer has been removed from 98% of our computers I am looking to make this page more accessible to the users. Therefore my idea was to code a HTML5 player using the audio tags directly on to the page. Now comes the tricky part. The audio WAV files are being delivered to the user from a database.

I have been able to get the player to load by using the following

<audio controls="controls" id="player" type="audio/wav">        
Your browser does not support the audio element.
</audio>

and then I modified the code on the audio file to

<span jwcid="@If" condition="ognl:item.recSegment.tape != null">
<button style="border:0px; background-color: transparent;"  onclick="document.getElementById('player').play()"jwcid="@Any" src="ognl:item.recSegment.tape.Url">
<center><img jwcid="@Image" image="asset:play" alt="Play"/></center>
</button>
</span>

After making these changes I opened up chrome and nothing happened. So then I opened up Firefox and when the button is clicked the player controls goes from paused to playing but does not load the file. So for a final try I loaded up Internet Explorer on a laptop and when the button is clicked the player says "Error:An unkown error occurred".

I feel at a loss here and know it is something simple I am missing. Does anybody have any Ideas?

Nick

Various browsers have differing support for the various codecs. Even though everyone thinks of WAV as just WAV, there are different codecs for that as well as differing bit depths and different browser have varying support for it (Internet Explorer [IE] has no support for WAV).

Firefox won't play .WAV files using the HTML5 <audio> tag?

http://www.w3schools.com/html/html5_audio.asp

According to the Mozilla Developer Network (MDN) the most widely supported formats are MP3 and AAC/MP4: https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats#Browser_compatibility

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM