惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Last Week in AI
Last Week in AI
D
DataBreaches.Net
腾讯CDC
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
云风的 BLOG
云风的 BLOG
罗磊的独立博客
月光博客
月光博客
MyScale Blog
MyScale Blog
U
Unit 42
Martin Fowler
Martin Fowler
Stack Overflow Blog
Stack Overflow Blog
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
G
Google Developers Blog
博客园 - 【当耐特】
D
Docker
I
InfoQ
雷峰网
雷峰网

HAOTOWN-疯狂减肥带

红米k30s至尊版magisk root - HAOTOWN-疯狂减肥带 网站备案通知 - HAOTOWN-疯狂减肥带 博客被黑了 - HAOTOWN-疯狂减肥带 VUE开发环境配置 - HAOTOWN-疯狂减肥带 NEWCITY2018 简单的typecho主题 - HAOTOWN-疯狂减肥带 一图壁纸安卓版更新日志 - HAOTOWN-疯狂减肥带 WEBAPP开发 - HAOTOWN-疯狂减肥带 优酷解析API - HAOTOWN-疯狂减肥带 TDPLAYER 脚本 替换ACFUN播放器 - HAOTOWN-疯狂减肥带
Hmusic.js - HAOTOWN-疯狂减肥带
haocity · 2017-05-10 · via HAOTOWN-疯狂减肥带

简单的H5音乐播放器

可直接播放网易云歌单

食用方法

引用hmusic.js

<script  src="hmusic.js" type="text/javascript" charset="utf-8"></script>

播放云歌单

var hm= new Hmusic(document.querySelector('.warp2'),{playlist:150301862});

Element:播放器所要放入的元素

playlist:网易云歌单ID

播放云音乐(多曲)

var hm= new Hmusic(document.querySelector('.warp2'),[{yunid: 4879869, img: "https://p1.music.126.net/tciqmgtNlLSgmAA--w4iLw==/1664660604466892.jpg", lrc: "https://t5.haotown.cn/yunmusic//?type=lyric&id=4879869&br=128000", title: "チルノのパーフェクトさんすう教室-歌ってみた"},{yunid: 29717270, img: "https://p1.music.126.net/oOGKq1fBwikj9IKsTM2TgQ==/3239161255894106.jpg", lrc: "https://t5.haotown.cn/yunmusic//?type=lyric&id=29717270&br=128000", title: "with“you”-絆-"}])

Element:播放器所要放入的元素

Yunid:网易单曲ID

img:封面

title:标题

Yunid可用audio替换 将直接作为地址

APIs

hm.play() 播放

hm.pause() 暂停

hm.playswitch() 切换播放状态 播放/暂停

hm.settime() 跳转当前歌曲到指定时间

hm.to() 跳转到指定歌曲 0为第一首

hm.add() 添加音乐(单个)

hm.getnowmusic() 获取当前音乐信息

演示

GITHUB