-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add playbackMetaBridge, loadAudio @ earliest time
Change list: 1. reorganise bridges into hooks/mediaEventBridges, within it there's a new playbackMetaBridge. Intent is to comms playback info and separate actions from playback info things. 2. now, when the server does a push_event for the audio events registration, we also send a separate event that is using this new bridge ("media_bridge:registerPlayback"), which dispatches the necessary client side events to register the playback, load the audio and the mediaSession as early as possible. Previously, this used to happen JIT, when the user was to press the play/pause button. This seems to have removed the initial time-delay we used to have between the instance when user clicks "play" and actual playback starting. 3. naturally, we also prevent redundant re-loads of audio now by guarding the source-setting for the html5 audio player. Broad TODOs: 1. consider pushing to the new playbackMetaBridge in the same intervals as the existing heartbeat. 2. this commit only added in message-passing from MediaBridgeHook to the AudioPlayerHook, but not in the other direction.
- Loading branch information
Showing
8 changed files
with
314 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* This file contains definitions for custom event bridges and keeps | ||
* the exporting of these clean. | ||
* */ | ||
|
||
import { bridged } from "./bridged.js"; | ||
|
||
export const seekTimeBridge = bridged("seekTime"); | ||
export const playPauseBridge = bridged("playPause"); | ||
export const heartbeatBridge = bridged("heartbeat"); | ||
/** | ||
* The playbackMetaBridge is the channel through which playback-metadata related | ||
* messages are passed. | ||
* An example would be when a voice first gets loaded/registered and we can | ||
* update the mediasessions api even if the user has not started the actual playback. | ||
* */ | ||
export const playbackMetaBridge = bridged("playback"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.