Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • funkwhale funkwhale
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 408
    • Issues 408
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • funkwhalefunkwhale
  • funkwhalefunkwhale
  • Merge requests
  • !1283

Properly handle redundant MediaSession play/pause requests

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Tony Wasserka requested to merge neobrain/funkwhale:fix_resume_on_sleep into develop Mar 24, 2021
  • Overview 10
  • Commits 1
  • Pipelines 3
  • Changes 4

MediaSession pause requests may happen even when Funkwhale is already in a paused state. Previously FW would flip between play/pause without consideration for the current state instead of doing nothing when the playback state matches the requested one.

Notably, this made Funkwhale resume audio playback when entering sleep mode on my system.

NOTE: My first attempt at fixing this used the navigator.mediaSession.playbackState property to read the requested from within togglePlay. That doesn't seem to work though, since at least on my browser (Firefox), that property is always None (perhaps for fingerprinting protection).

Manual testing:

  • Pause/Play button in the UI works as expected
    • Large mode
    • Tablet mode
  • Going to sleep pauses a playing track
  • Going to sleep does not resume a paused track
  • Pressing "p" toggles pause/play
Edited Mar 28, 2021 by Tony Wasserka
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix_resume_on_sleep