简体   繁体   English

HTML5 Player替换Windows Media Player插件

[英]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. 我有一个本地托管的网页,当前如果将其加载到Internet Explorer中,则会通过Windows Media Player插件播放音频文件(WAV格式)。 Being that Internet Explorer has been removed from 98% of our computers I am looking to make this page more accessible to the users. 由于Internet Explorer已从我们98%的计算机中删除,因此我希望使用户可以更轻松地访问此页面。 Therefore my idea was to code a HTML5 player using the audio tags directly on to the page. 因此,我的想法是使用直接在页面上的音频标签编写HTML5播放器的代码。 Now comes the tricky part. 现在是棘手的部分。 The audio WAV files are being delivered to the user from a database. 音频WAV文件正在从数据库传递给用户。

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. 进行了这些更改之后,我打开了chrome,但是什么也没发生。 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. 因此,我打开了Firefox,然后单击该按钮,播放器控件从暂停状态变为播放状态,但未加载文件。 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". 因此,作为最后的尝试,我在笔记本电脑上加载了Internet Explorer,单击该按钮时,播放器显示“错误:发生未知错误”。

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). 即使每个人都将WAV视为WAV,但是对此有不同的编解码器以及不同的位深度,并且不同的浏览器对此也有不同的支持(Internet Explorer [IE]不支持WAV)。

Firefox won't play .WAV files using the HTML5 <audio> tag? Firefox无法使用HTML5 <audio>标签播放.WAV文件吗?

http://www.w3schools.com/html/html5_audio.asp 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 根据Mozilla开发人员网络(MDN),支持最广泛的格式是MP3和AAC / MP4: https : //developer.mozilla.org/zh-CN/docs/Web/HTML/Supported_media_formats#Browser_compatibility

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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