track and manage video state #890
No reviewers
Labels
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-desktop#890
Loading…
Reference in a new issue
No description provided.
Delete branch "video-state"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This feature tracks play and pause actions on a video element. Below is a model of the parts.
blue = state
red = actions
purple = reducers
light blue = selectors
green = component lifecycle hooks
orange = distant component which can alter state
black = not React/Redux
Great stuff! I see you are tracking time when the video pauses, I was hoping that you would update the time using this listener instead https://www.w3schools.com/tags/av_event_timeupdate.asp
i.e.
mediaElement.addEventListener("timeupdate", doUpdatePlayback);
Are we using the time for something other than starting back where the user left off?
@daovist yes, exactly. There are going to be several features that depend on this
Overall excellent PR! I tested it locally and it works well, but there are a few small changes before it can be merged.
@ -6,2 +1,2 @@
import { makeSelectMetadataForUri, makeSelectContentTypeForUri } from 'redux/selectors/claims';
import { setVideoPause } from 'redux/actions/video';
import React from "react";
import { connect } from "react-redux";
please remove this comment when ready to merge :)
@ -15,3 +15,1 @@
import { selectVideoPause } from 'redux/selectors/video';
import Video from './view';
import { selectPlayingUri } from 'redux/selectors/content';
} from "redux/selectors/file_info";
please remove this comment when ready to merge
please remove this comment when ready to merge
as I said in a comment below, does this work for
lbry://one
?please remove when ready to merge :)
can you define a type more specifically than
Object
? Maybe{ [string]: number }
?https://flow.org/en/docs/types/objects/#toc-objects-as-maps
will this work when the uri does not contain a
#
such as in the case oflbry://one
?@ -0,0 +1,17 @@
import * as settings from "constants/settings";
I noticed that
/selectors/video.js
has not been deleted. Are we still using it?@ -68,3 +67,4 @@
media: mediaReducer,
});
const bulkThunk = createBulkThunkMiddleware();
do we still need
video: videoReducer,
?@daovist outpoint not claimid
a8988d9
Some minor code feedback, as well as the feedback given in office that it would be excellent if the video showed the same frame it was on prior to hitting play.
what kind of id? I assume this is a
claimId
, let's call it thatThe fact that
Video
is receiving so many properties simply to pass them on toVideoPlayer
makes me thinkVideoPlayer
should just be a first-class component. Although perhaps the names should be clarified if this is the case.I was also thinking it should be its own component. Maybe as a separate issue along with displaying a paused video instead of the image wrapper when position has a value?
this looks good, im just going to check this out locally, but otherwise im happy with it
remove comment please
I agree. #825 can work as a reference as the media component has been separated there. Also I think that Video and VideoPlayer names are very specific, we use the same component to render all other types of media as well, so IMO the variables and components should be refactored to reflect the same(also in the PR).
Thoughts?