音乐播放

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
        tr td {
            border-bottom: 1px solid;
            margin: 1px;
        }
    </style>
    <script src="js/angular.min.js"></script>
    <script src="js/angular-route.js"></script>
    <script>
        angular.module("myApp", ["ngRoute"])
            .config(function($routeProvider) {
                $routeProvider.when("/:path",{

                    templateUrl: "play_music.html",
                    controller: "demoA"
                })

            }).controller("demoC", function($scope,  $http) {

                $http.get('sings.json').success(function(resp) {
                    $scope.sings=resp;

                })
            }).controller("demoA",function($scope,$routeParams){
                $scope.path=$routeParams.path;
            });
    </script>

</head>
<body ng-app="myApp" ng-controller="demoC">
    <table>
        <thead>
        </thead>
        <tr>
            <td><input type="checkbox" /></td>
            <td>全选</td>
            <td colspan="2"><input type="button" value="播放选中的歌曲" /></td>
            <td>播放</td>
            <td>歌词</td>
            <td>下载</td>
        </tr>
        <tr ng-repeat="s in sings">
            <td><input type="checkbox" /></td>
            <td> {{$index+1}}</td>
            <td>{{s.sname}}</td>
            <td>{{s.author}}</td>
            <td>
                <a href={{s.spath}}>播放</a>
            </td>
            <td>歌词</td>
            <td>下载</td>
        </tr>
    </table>
    <div ng-view></div>
</body>
</html>

=========================================

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
    <audio  controls="controls" autoplay >
        <source src={{path}}></source>

        您的浏览器暂时不支持mp3个,ogg格式音频文件
    </audio>
</body>
</html>

=======================
json串

[{"sname":"夜夜夜","author":"齐秦","spath":"#/aa.mp3","type":"经典老歌"},
{"sname":"执着","author":"田震","spath":"#/bb.mp3","type":"经典老歌"},
{"sname":"他一定很爱你","author":"阿杜","spath":"#/cc.mp3","type":"经典老歌"},
{"sname":"别","author":"薛之谦","spath":"#/aa.mp3","type":"好听"},
{"sname":"放开","author":"朱丽叶","spath":"#/aa.mp3","type":"好听"}
]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值