change to username display
This commit is contained in:
parent
e59ae5a9f8
commit
cb0ff28b61
2 changed files with 14 additions and 4 deletions
|
@ -119,19 +119,22 @@ const app = new Vue({
|
|||
details: {}
|
||||
},
|
||||
chrome: {
|
||||
artworkReady: false
|
||||
artworkReady: false,
|
||||
userinfo: {
|
||||
|
||||
}
|
||||
},
|
||||
page: "browse"
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
async init() {
|
||||
let self = this
|
||||
this.mk = MusicKit.getInstance()
|
||||
this.mk.authorize()
|
||||
this.$forceUpdate()
|
||||
|
||||
// Set profile name
|
||||
this.mk.api.personalSocialProfile().then(function(result) {document.getElementById("userName").innerHTML = result.attributes.name});
|
||||
this.chrome.userinfo = await this.mkapi("personalSocialProfile", false, "")
|
||||
|
||||
this.mk.addEventListener(MusicKit.Events.playbackTimeDidChange, (a) => {
|
||||
self.playerLCD.playbackDuration = (self.mk.currentPlaybackTime)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue