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

Save media position in video viewer #4104

Merged
merged 3 commits into from
May 1, 2020
Merged

Conversation

jeffslofish
Copy link
Contributor

@jeffslofish jeffslofish commented Apr 30, 2020

PR Checklist

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe:

Fixes

Issue Number: #2775

What is the current behavior?

Videos start playing at beginning of the video.

What is the new behavior?

Video position is saved when being played. If a previously viewed video is played again, it starts at the saved location.

Other information

jeffslofish added a commit to jeffslofish/lbry-desktop that referenced this pull request Apr 30, 2020
@jeffslofish
Copy link
Contributor Author

I abandoned my previous pull request (#4098) and created this clean one with the changes you wanted.

@neb-b
Copy link

neb-b commented Apr 30, 2020

Nice! I like the minimal changes. Do you notice any issues writing that value so often? If so, maybe it should only be written every x seconds or so? Or when the video stops?

@neb-b neb-b self-requested a review April 30, 2020 14:17
@lbry-bot lbry-bot assigned neb-b and unassigned neb-b Apr 30, 2020
@jeffslofish
Copy link
Contributor Author

I didn't notice any issue, but perhaps there would be on some devices. Let me see what I can do to make it write less often (hopefully just once)...

@jeffslofish jeffslofish marked this pull request as draft April 30, 2020 18:22
@jeffslofish
Copy link
Contributor Author

I updated the code to only save the media position on pause or dispose (in case they leave the page without stopping the video first) instead of every timeupdate event. This should help out performance and save the position in the majority of cases.

@jeffslofish jeffslofish marked this pull request as ready for review May 1, 2020 04:36
@neb-b neb-b merged commit 7ea9c1c into lbryio:master May 1, 2020
neb-b pushed a commit that referenced this pull request May 1, 2020
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

Successfully merging this pull request may close these issues.

2 participants