Skip to content

feat(sdk): add configurable media3 player builder - #127

Open
jonathancaudill wants to merge 1 commit into
lightphone:mainfrom
jonathancaudill:feat/light-audio-media3-configurator
Open

feat(sdk): add configurable media3 player builder#127
jonathancaudill wants to merge 1 commit into
lightphone:mainfrom
jonathancaudill:feat/light-audio-media3-configurator

Conversation

@jonathancaudill

Copy link
Copy Markdown

Okie-dokie!

First draft of some more advanced audio capabilities. I can edit the description later as needed before merge.

So as it turns out, I forgot a crucial detail in #119 . The SDK sandbox blocks most stuff regarding Context. So a straight-up handoff isn't really feasible. Below is what I think will work pretty well, and it still honors the split.

SDK's default audio behavior and simple building of LightAudioPlayer instances is unchanged.

SDK will allow more advanced specs to be given when building an ExoPlayer instance via the configure argument. SDK will also allow tools to change aspects of the media3 pipeline live--queueing, etc. Which is good, because streaming requires a lot of small changes to be made as cell service comes and goes, as the user queues up tracks, etc.

SDK will also enforce one LightMediaEnv per tool & one SimpleCache object per directory.

@dupontgu

Copy link
Copy Markdown
Contributor

Excited to take a look at this! Hopefully will get a chance by EOW

@dupontgu

Copy link
Copy Markdown
Contributor

I did a quick pass and I know @brunoro is doing the same since he's kinda owning the audio stuff.

I've just got a few little API suggestions that I put up here: 5d073d2

Basically just made a base LightAudioPlayerCore class that can take any arbitrary Player instance (as you added), and then made it so LightAudioPlayer extends that but explicitly takes in an ExoPlayer instance. I think it A) makes it a little clearer that LightAudioPlayer is kind of a safe default (but you can write your own extension of LightAudioPlayerCore if you wanna go nuts) and B) adds a cleaner surface to add those ExoPlayer-specific calls like skipSilenceEnabled.

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