Save media position in video viewer #4104

Merged
jeffslofish merged 3 commits from issue-2775-1 into master 2020-05-01 16:14:30 +02:00
jeffslofish commented 2020-04-30 09:57:05 +02:00 (Migrated from github.com)

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

PR Checklist <!-- For the checkbox formatting to work properly, make sure there are no spaces on either side of the "x" --> Please check all that apply to this PR using "x": - [x] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged) - [x] 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 - [x] 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 <!-- If this PR contains a breaking change, please describe the impact and solution strategy for existing applications below. -->
jeffslofish commented 2020-04-30 10:05:36 +02:00 (Migrated from github.com)

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

I abandoned my previous pull request (#4098) and created this clean one with the changes you wanted.
neb-b commented 2020-04-30 16:17:40 +02:00 (Migrated from github.com)

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?

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?
jeffslofish commented 2020-04-30 20:21:05 +02:00 (Migrated from github.com)

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)...

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 commented 2020-05-01 06:36:41 +02:00 (Migrated from github.com)

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.

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.
neb-b (Migrated from github.com) approved these changes 2020-05-01 16:00:55 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#4104
No description provided.