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

Playback incorrectly jumps when playing parent of segment already being played #154

Open
defagos opened this issue Jul 9, 2020 · 2 comments
Labels
bug Issue to be fix (issue and PR)

Comments

@defagos
Copy link
Member

defagos commented Jul 9, 2020

When already playing a segment, tapping on its full-length elsewhere in the app restarts it at the beginning. This should not be the case (the content is namely the same).

Issue type

Incorrect behavior

Environment information

  • Application version: Any, but tested with 3.0.0
  • iOS version: Any
  • Device: Any

Reproducibility

Always reproducible

Code sample

Steps to reproduce

  1. Enable background video playback (segments are for on-demand content mostly).
  2. Play a 19h30 segment, either directly or as part of normal playback (no active selection required).
  3. Close the player. Playback continues in the background.
  4. Now find this 19h30 item elsewhere in the app and tap on it. Instead of just reopening the player, playback restarts at the beginning.

Note that this issue is a bit more visible with 3.1.0 and program segments: Because you don't need background video playback to be enabled (this is audio after all), playing a livestream and tapping on the same item on the live tab will move the playback position to the live edge.

@defagos defagos added the bug Issue to be fix (issue and PR) label Jul 9, 2020
@defagos defagos modified the milestones: 3.1.0, 3.1.1 Jul 9, 2020
@defagos
Copy link
Member Author

defagos commented Jul 9, 2020

This issue follows from current Letterbox behaviour as well as Play implementation. We should improve both:

Letterbox

Currently, playing the same content as already being played is a no-op. We should adopt a behaviour to watch the -switch method does, more precisely:

  • If playing the same media or URN as already being played:
    • If a position has been provided, seek to it.
    • If the default position is used (nil), do not do anything.
  • If playing the parent media or URN of the media already being played:
    • If a position has been provided, seek to it.
    • If the default position is used (nil), do not do anything.
  • If playing a sibling media or URN as the media already being played, switch.

Maybe the last two cases can be reduced to a simple -switch method call

Play

In Play, we should simplify our MediaPlayerViewController API by removing creation for a URN or media, only retaining creation with a controller provided externally.

This way, depending on what is being played in the service controller and what the user wants to play, we can reuse the service controller with the updated Letterbox logic above and pass it to the media player view controller for display. We can then probably eliminate all original...-based ugly code and simplify our implementation of -playURN or -playMedia in Play.

This behavior exists since a long time, I propose we fix it for 3.1.1.

@defagos
Copy link
Member Author

defagos commented Oct 19, 2021

The same issue affects livestreams, for all platforms (including CarPlay where it can be a bit more annoying):

  1. Play some radio channel.
  2. Go back, then tap on the channel again.
  3. Playback is reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue to be fix (issue and PR)
Projects
None yet
Development

No branches or pull requests

2 participants