SLPlayer immediate updates
This commit is contained in:
parent
94d6bd0c1b
commit
162505c75e
|
@ -144,6 +144,7 @@ export default {
|
|||
duration: this.playerduration,
|
||||
state: this.playerstatus
|
||||
}
|
||||
this.lastSentTimeline = playerdata
|
||||
return data.callback(playerdata)
|
||||
}
|
||||
if (data.command === '/player/playback/play') {
|
||||
|
@ -227,7 +228,9 @@ export default {
|
|||
// Browser
|
||||
browser: this.getBrowser(),
|
||||
dialog: false,
|
||||
destroyed: false
|
||||
destroyed: false,
|
||||
|
||||
lastSentTimeline: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -601,6 +604,30 @@ export default {
|
|||
this.playerstatus = data.status
|
||||
this.bufferedTill = data.bufferedTill
|
||||
this.playerduration = data.duration
|
||||
|
||||
if (this.lastSentTimeline.state !== data.status || this.chosenKey !== this.lastSentTimeline.key) {
|
||||
let key = this.chosenKey
|
||||
let ratingKey = null
|
||||
if (key) {
|
||||
ratingKey = '/library/metadata/' + key
|
||||
}
|
||||
let machineIdentifier = null
|
||||
if (this.chosenServer) {
|
||||
machineIdentifier = this.chosenServer.clientIdentifier
|
||||
}
|
||||
let playerdata = {
|
||||
key: key,
|
||||
ratingKey: ratingKey,
|
||||
time: this.playertime,
|
||||
type: 'video',
|
||||
machineIdentifier: machineIdentifier,
|
||||
duration: this.playerduration,
|
||||
state: this.playerstatus
|
||||
}
|
||||
this.lastSentTimeline = playerdata
|
||||
console.log('Emitting an immediate change')
|
||||
this.chosenClient.updateTimelineObject(playerdata)
|
||||
}
|
||||
},
|
||||
playerSeekDone (data) {},
|
||||
generateTranscodeUrl (overrideparams) {
|
||||
|
|
|
@ -382,9 +382,9 @@ export default {
|
|||
},
|
||||
playerStateChanged (playerCurrentState) {
|
||||
// console.log("Setting volume to " + this.player.volume() || 0)
|
||||
this.$store.commit('setSettingPTPLAYERVOLUME', this.player.volume() || 0)
|
||||
this.$store.commit('setSetting', ['PTPLAYERVOLUME', this.player.volume() || 0])
|
||||
this.bufferedTill = Math.round(this.player.buffered().end(0) * 1000)
|
||||
this.duration = Math.round(this.player.duration() * 1000)
|
||||
this.duration = Math.round(this.player.duration() * 1000)
|
||||
this.bufferStart = Math.round(this.player.buffered().start(0) * 1000)
|
||||
this.bufferEnd = Math.round(this.player.buffered().end(0) * 1000)
|
||||
if (this.player.error_) {
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
</img>
|
||||
</v-list-tile-avatar>
|
||||
<v-list-tile-content>
|
||||
<v-tooltip bottom color="primary">
|
||||
<v-tooltip bottom color="secondary">
|
||||
<span slot="activator">
|
||||
<v-list-tile-title> {{ user.username }} <span style="opacity: 0.6" v-if="user.uuid === me.uuid"> (you) </span></v-list-tile-title>
|
||||
<v-list-tile-sub-title style="opacity:0.6;color:white;font-size:70%">{{ getTitle(user) }}</v-list-tile-sub-title>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
$theme := {
|
||||
primary: #E5A00D
|
||||
accent: $red.accent-2
|
||||
secondary: #F3B32B
|
||||
secondary: #353e58
|
||||
info: $blue.lighten-1
|
||||
warning: $amber.darken-2
|
||||
error: $red.accent-4
|
||||
|
|
Loading…
Reference in New Issue