fixed player duration not updating correctly
This commit is contained in:
parent
cb924ccaa3
commit
eb912c5c5f
3 changed files with 79 additions and 50 deletions
|
@ -67,7 +67,7 @@
|
||||||
<input type="range" step="0.01" min="0"
|
<input type="range" step="0.01" min="0"
|
||||||
@change="mk.seekToTime($event.target.value)"
|
@change="mk.seekToTime($event.target.value)"
|
||||||
:max="mk.currentPlaybackDuration"
|
:max="mk.currentPlaybackDuration"
|
||||||
:value="mk.currentPlaybackProgress * 100">
|
:value="playerLCD.playbackDuration">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions">❤️</div>
|
<div class="actions">❤️</div>
|
||||||
|
|
|
@ -19,6 +19,17 @@ Vue.component('mediaitem-list-item', {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const MusicKitTools = {
|
||||||
|
getHeader() {
|
||||||
|
return new Headers({
|
||||||
|
Authorization: 'Bearer ' + MusicKit.getInstance().developerToken,
|
||||||
|
Accept: 'application/json',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Music-User-Token': '' + MusicKit.getInstance().musicUserToken
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
el: "#app",
|
el: "#app",
|
||||||
data: {
|
data: {
|
||||||
|
@ -29,13 +40,20 @@ const app = new Vue({
|
||||||
term: "",
|
term: "",
|
||||||
results: {}
|
results: {}
|
||||||
},
|
},
|
||||||
|
playerLCD: {
|
||||||
|
playbackDuration: 0
|
||||||
|
},
|
||||||
page: "browse"
|
page: "browse"
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
|
let self = this
|
||||||
this.mk = MusicKit.getInstance()
|
this.mk = MusicKit.getInstance()
|
||||||
this.mk.authorize()
|
this.mk.authorize()
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
|
this.mk.addEventListener(MusicKit.Events.playbackTimeDidChange, (a)=>{
|
||||||
|
self.playerLCD.playbackDuration = (self.mk.currentPlaybackTime)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
showSearch() {
|
showSearch() {
|
||||||
this.page = "search"
|
this.page = "search"
|
||||||
|
|
11
resources/cider-ui-tests/todo.js
Normal file
11
resources/cider-ui-tests/todo.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
// Made For You
|
||||||
|
app.mk.api.recommendations({extend: "editorialArtwork,artistUrl"})
|
||||||
|
|
||||||
|
// Library with library length
|
||||||
|
/** This will return 100 tracks in an array, however
|
||||||
|
* the library total length is not returned but present in the network traffic response under
|
||||||
|
* meta.total. We need a way to get the full response from the network traffic.
|
||||||
|
*/
|
||||||
|
await app.mk.api.library.songs({limit: 100}).then((data)=>{
|
||||||
|
console.log(data)
|
||||||
|
})
|
Loading…
Add table
Add a link
Reference in a new issue