Audio5js是一款html5,具有适用于旧浏览器的闪存兼容性。这是源代码和开发人员网站的链接
Github:https://github.com/zohararad/audio5js
我使用了播放器的角度示例
我创建了一个插件:http://plnkr.co/edit/Ma1zzsze1R31p3QZOyW8?p=preview
<script src="https://code.angularjs.org/1.2.9/angular.min.js"></script>
<script src="https://rawgithub.com/zohararad/audio5js/master/audio5.js"></script>
<!--include ngAudio5.js after audio5.js-->
<script src="ngAudio5.js"></script>
<script>
//inject Audio5 service into our app
var app = angular.module('myapp',['Audio5']);
//Inject the AudioService singleton
var PlayCtrl = function ($scope, AudioService) {
//bind AudioService to scope
$scope.player = AudioService;
//Load the song, every event, class method and Instance attribute from audio5js are accessible from the template
$scope.player.load('http://danosongs.com/music/danosongs.com-orb-of-envisage.mp3');
//example of event binding
$scope.player.on('timeupdate',function(){
$scope.$apply();
})
}
</script>
奇怪的是它正在所有浏览器上工作,除了Mac上的chrome。
chrome的版本:版本36.0.1985.125 版本的MAC OS:OS X 10.9.4
请查看插件并告知我是否有任何问题
答案 0 :(得分:0)
删除codecs = mp3,当js文件中的音频类型为mp3时。它由开发人员修复。 github上的源代码已更新