Attempting to fix play/pause but no dice; Working on Chrome + Android
This commit is contained in:
@ -107177,10 +107177,19 @@ var MediaSession = /*#__PURE__*/function (_React$Component) {
|
||||
artists = _current_track$artist === void 0 ? [] : _current_track$artist,
|
||||
_current_track$images = current_track.images,
|
||||
images = _current_track$images === void 0 ? {} : _current_track$images;
|
||||
|
||||
if (current_track.duration) {
|
||||
navigator.mediaSession.setPositionState({
|
||||
duration: current_track.duration,
|
||||
playbackRate: 1,
|
||||
position: 0
|
||||
});
|
||||
}
|
||||
|
||||
navigator.mediaSession.metadata = new window.MediaMetadata({
|
||||
title: stream_title || title,
|
||||
artist: artists.length ? artists[0].name : null,
|
||||
album: album.name,
|
||||
title: stream_title || title || '-',
|
||||
artist: artists.length ? artists[0].name : '-',
|
||||
album: album.name || '-',
|
||||
artwork: [].concat(_toConsumableArray(images.small ? [{
|
||||
src: images ? images.small : '',
|
||||
sizes: '96x96',
|
||||
@ -107197,7 +107206,10 @@ var MediaSession = /*#__PURE__*/function (_React$Component) {
|
||||
});
|
||||
}
|
||||
|
||||
navigator.mediaSession.playbackState = play_state;
|
||||
if (navigator.mediaSession.playbackState !== play_state) {
|
||||
navigator.mediaSession.playbackState = play_state;
|
||||
}
|
||||
|
||||
return _objectSpread(_objectSpread({}, state), {}, {
|
||||
current_track: current_track,
|
||||
stream_title: stream_title
|
||||
|
||||
File diff suppressed because one or more lines are too long
14
mopidy_iris/static/app.min.js
vendored
14
mopidy_iris/static/app.min.js
vendored
File diff suppressed because one or more lines are too long
@ -106,7 +106,7 @@
|
||||
|
||||
// Release details
|
||||
// These are automatically injected to built HTML
|
||||
var build = "1607238948";
|
||||
var build = "1607328717";
|
||||
var version = "3.55.1";
|
||||
|
||||
// Construct the script tag
|
||||
|
||||
@ -34,10 +34,18 @@ class MediaSession extends React.Component {
|
||||
images = {},
|
||||
} = current_track;
|
||||
|
||||
if (current_track.duration) {
|
||||
navigator.mediaSession.setPositionState({
|
||||
duration: current_track.duration,
|
||||
playbackRate: 1,
|
||||
position: 0,
|
||||
});
|
||||
}
|
||||
|
||||
navigator.mediaSession.metadata = new window.MediaMetadata({
|
||||
title: stream_title || title,
|
||||
artist: artists.length ? artists[0].name : null,
|
||||
album: album.name,
|
||||
title: stream_title || title || '-',
|
||||
artist: artists.length ? artists[0].name : '-',
|
||||
album: album.name || '-',
|
||||
artwork: [
|
||||
...(images.small ? [{
|
||||
src: images ? images.small : '',
|
||||
@ -58,7 +66,9 @@ class MediaSession extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
navigator.mediaSession.playbackState = play_state;
|
||||
if (navigator.mediaSession.playbackState !== play_state) {
|
||||
navigator.mediaSession.playbackState = play_state;
|
||||
}
|
||||
|
||||
return {
|
||||
...state,
|
||||
|
||||
Reference in New Issue
Block a user