APlayer+HTML播放示例

<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>您有一条语音消息</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
    body {
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    }
    .container {
        max-width: 32rem;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 50px;
    }
    h1 {
        font-size: 34px;
        color: #333;
        margin: 30px 0 10px;
    }
    h3 {
        margin-top: 20px;
        color: #999;
        font-weight: normal;
        letter-spacing: 1px;
    }
    .aplayer-wrap {
      max-width: 90%;
      margin: 20px 0;
    }
</style>
</head>
<body>

    <div style="width: 100%; height: 70%; text-align: center;">
    <br/><br/><br/>
        <h1>您有一条语音消息</h1>
        <h3>🍭请点击收听☟</h3>
    </div>
    <center>
    <div class="aplayer-wrap">
    <div id="player" class="aplayer"></div>
    <h3>☝请点击收听☝</h3>
    </div></center>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/aplayer/1.10.1/APlayer.min.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/aplayer/1.10.1/APlayer.min.css">
    <script>
        const ap = new APlayer({
        container: document.getElementById('player'),
        listFolded: false,
        fixed: false, //吸底模式
        mini: true, //迷你模式
        listMaxHeight: 900,
        volume: 0.4,
        audio: [
                {
                    name: '哪里都是你-队长',
                    artist: '哪里都是你',
                    url: '10082346.mp3',
                    cover: 'Cover.jpg',
                    theme: '#F4A7B9'
                }
            ]
        });

    </script>
</body>

效果预览

在这里插入图片描述
在这里插入图片描述

https://aplayer.js.org/#/zh-Hans/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值