[Proposal] Control panel #32
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
output2.mp4
Video: controlling playback from RxPaired.
This PR is a proposal where I implement a "control panel" on the bottom of RxPaired when at least one player is instantiated (it should work even with multiple players at the same time).
Its goal for now is to be compatible with the RxPlayer but also every other players: on the client-side, a new
__RX_PAIRED_PLAYERS__object is globally declared, with two methods,addandremove.A common API has to be setup when
addis called so that RxPaired can send commands (play/pause/reloadetc.).I did not yet implement some key advanced features for now: setting an audio/text/video track, changing the quality etc., as those require an event mechanism (advertising about available tracks and qualities for example) that I didn't specify for the moment to keep it simple.
To make it work with a player
To link the control panel to a player (the RxPlayer or any other player), special code has to be written on the player side, implementing the various available commands.
Players can even provide an incomplete implementation (with not all methods defined) in which case RxPaired will properly detect it and not display the unavailable ones in the inspector.
Here's the example of the implem I made for the RxPlayer: