Changeset View
Changeset View
Standalone View
Standalone View
extension/content-script.js
Show First 20 Lines • Show All 337 Lines • ▼ Show 20 Line(s) | 321 | function setPlayerActive(player) { | |||
---|---|---|---|---|---|
338 | activePlayer = player; | 338 | activePlayer = player; | ||
339 | 339 | | |||
340 | // when playback starts, send along metadata | 340 | // when playback starts, send along metadata | ||
341 | // a website might have set Media Sessions metadata prior to playing | 341 | // a website might have set Media Sessions metadata prior to playing | ||
342 | // and then we would have ignored the metadata signal because there was no player | 342 | // and then we would have ignored the metadata signal because there was no player | ||
343 | sendMessage("mpris", "playing", { | 343 | sendMessage("mpris", "playing", { | ||
344 | mediaSrc: player.currentSrc || player.src, | 344 | mediaSrc: player.currentSrc || player.src, | ||
345 | pageTitle: document.title, | 345 | pageTitle: document.title, | ||
346 | poster: player.poster, | ||||
346 | duration: player.duration, | 347 | duration: player.duration, | ||
347 | currentTime: player.currentTime, | 348 | currentTime: player.currentTime, | ||
348 | playbackRate: player.playbackRate, | 349 | playbackRate: player.playbackRate, | ||
349 | volume: player.volume, | 350 | volume: player.volume, | ||
350 | muted: player.muted, | 351 | muted: player.muted, | ||
351 | loop: player.loop, | 352 | loop: player.loop, | ||
352 | metadata: playerMetadata, | 353 | metadata: playerMetadata, | ||
353 | callbacks: playerCallbacks, | 354 | callbacks: playerCallbacks, | ||
▲ Show 20 Lines • Show All 665 Lines • Show Last 20 Lines |