QPlayer插件究竟该怎么导入网易云音乐?

原文链接:QPlayer插件究竟该怎么导入网易云音乐? - 北極星 - 博客园

QPlayer插件做得很好啊

奈何不会添加歌曲

这里记录一下:

这里以添加网易云音乐为例子

1.

首先,打开网易云音乐的首页,我是添加的单曲

以下面链接为例子:https://music.163.com/#/song?id=484056997

点击去之后,你看到网址栏有一个  "id=484056997"

2.

那么,这首歌的真实地址就是:

http://music.163.com/song/media/outer/url?id=484056997.mp3

既是网易云音乐当前页面歌曲得实际链接:

http://music.163.com/song/media/outer/url?id=ID数字.mp3

把上面红色部分ID数字换成网易云播放页面的id即可。

3.

Typecho设置如下

关于:"cover": "http://p1.music.126.net/cLoAM3X8pIuCil_oJpxjWw==/18511377767183768.jpg?param=130y130"

 4.

阅读终点,创作起航,您可以撰写心得或摘录文章要点写篇博文。去创作
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的 Vue 网易音乐播放器的代码示例,仅供参考: ``` <template> <div> <audio ref="audio" :src="currentSong.url" @timeupdate="handleTimeupdate"> </audio> <div class="player"> <div class="player__controls"> <button class="player__control-btn" @click="togglePlaying"> {{ isPlaying ? '暂停' : '播放' }} </button> <div class="player__progress-wrapper"> <div class="player__progress" :style="{ width: progressBarWidth }"></div> </div> <button class="player__control-btn" @click="nextSong"> 下一首 </button> </div> <div class="player__info"> <div class="player__song-name">{{ currentSong.name }}</div> <div class="player__artist">{{ currentSong.artist }}</div> <div class="player__lyrics" v-html="lyrics"></div> </div> </div> </div> </template> <script> import { mapGetters, mapActions } from 'vuex' export default { computed: { ...mapGetters(['currentSong', 'isPlaying', 'lyrics']), progressBarWidth() { return `${(this.currentTime / this.currentSong.duration) * 100}%` }, }, methods: { ...mapActions(['togglePlay', 'next']), togglePlaying() { this.togglePlay() if (this.isPlaying) { this.$refs.audio.play() } else { this.$refs.audio.pause() } }, nextSong() { this.next() this.$refs.audio.load() this.$refs.audio.play() }, handleTimeupdate() { this.$store.commit('setCurrentTime', this.$refs.audio.currentTime) }, }, } </script> <style> .player { display: flex; flex-direction: row; align-items: center; justify-content: space-between; padding: 20px; background-color: #eee; } .player__controls { display: flex; flex-direction: row; align-items: center; } .player__control-btn { margin-right: 20px; padding: 10px; font-size: 16px; background-color: #ccc; border: none; border-radius: 5px; cursor: pointer; } .player__progress-wrapper { width: 300px; height: 10px; background-color: #fff; border-radius: 5px; margin: 0 20px; position: relative; } .player__progress { height: 100%; background-color: #333; border-radius: 5px; position: absolute; top: 0; left: 0; } .player__info { flex: 1; text-align: center; margin-left: 20px; } .player__song-name { font-size: 24px; font-weight: bold; } .player__artist { font-size: 16px; color: #666; margin-top: 10px; } .player__lyrics { margin-top: 20px; font-size: 16px; line-height: 1.5; text-align: center; } </style> ``` 这是一个简单的 Vue 组件,包含了播放器控制按钮、进度条、歌曲信息和歌词展示等。该组件使用 Vuex 管理播放状态和歌曲列表,使用 HTML5 的 Audio API 实现播放功能,使用 Vue 的计算属性和方法实现进度条和用户交互等功能。需要注意的是,该组件仅供参考,具体实现可能需要根据实际需求进行适当调整。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值