Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play episode button behavior #1339

Closed
mrbotmd opened this issue Nov 2, 2023 · 3 comments
Closed

Play episode button behavior #1339

mrbotmd opened this issue Nov 2, 2023 · 3 comments

Comments

@mrbotmd
Copy link

mrbotmd commented Nov 2, 2023

When episode is being played additional button press will restart whole episode.
image
This issue is probably related to #1195 due to playback not stopping on player close. And inability to resume playback when player is closed.

I propose:

  1. Adding current playback time and resuming from there when player is paused and open.
  2. Stopping playback on button click when episode is being played and player is open.
  3. When player is closed, open player and resume playback.
@mrbotmd
Copy link
Author

mrbotmd commented Nov 2, 2023

This button runs this function in src/state/player

And it's setting currentTime to 0 every time button is pressed.

async function play_show(show: Show) {
...
	if (state.audio) {
		state.audio.pause(); <- Here playback is paused
...
		state.audio.addEventListener('loadedmetadata', () => {
			if (state.audio) {
				state.audio.currentTime = 0; <- Here it's being reset
				resolve(state.audio.play());
			}
		});
	}
...
}

@themisterholliday
Copy link
Contributor

I'm just reading through all the issues so tagging these related issues:
#1363
#1195

@stolinski
Copy link
Collaborator

While the Play button will still start the episode over from the start, this is intended but a much better experience now that we can minimize the player, pause and play.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants