Comments (3)
However, this approach is not viable for us, since we're fetching the stream links dynamically (more on that here). So the url in MediaItem is not yet a valid one (it contains just information to fetch the link, smth like app://play?media_id=1). The actual url is fetched using
ResolvingDataSource
.Previously we were sending an additional field in our media responses from the backend that contained the available transport methods (HLS, DASH etc). Based on that, we were creating a correspondent
MediaSourceFactory
on the fly (thatMediaSourceFactory
was created withResolvingDataSource
). However, this seems to be a sort of hack that we'd like to avoid to make our app more scalable (not to mention that this does not fit into media3 architecture at all)
Possibly obvious question: Given the original 'dynamic' URL do you know whether it will resolve to a DASH or HLS URL? If you do know that in advance then you can just use MediaItem.Builder#setMimeType
and everything should just work (this will override any inference done from the URL ending).
Otherwise it sounds like you're looking for a 'do everything' MediaSource
. We don't currently have one of those - though there is a draft DefaultMediaSource
in a commit linked from google/ExoPlayer#3165 (comment) which you may find useful as inspiration (I haven't compared it in detail to what you've posted).
from media.
Thanks for a quick reply.
Regarding dynamic URL: yes, we could include stream type there & then set up mime type, but that's exactly what we'd like to avoid :)
As for the draft commit you provided – this looks kinda promising. I'll take a deeper dive & get back to you
from media.
I've dug into the example you provided and it's pretty much the same with what I've come up with. Thanks!
from media.
Related Issues (20)
- Send timed metadata to controller HOT 2
- Migration documentation missing on Android Dev website HOT 6
- Add Google Voice Assistant to Media3 (Exoplayer) demo Android app to search through the exolist file with voice call HOT 4
- Update Notification Title during playback HOT 5
- Fail to play MPD Widevine with ClearKeys HOT 4
- Redundant fetches of album artwork URI HOT 6
- ExoPlayer.moveMediaItems does not update the shuffle order HOT 2
- Allow adding MediaItems contiguously to a ShuffleOrder HOT 1
- Use media3.Exoplayer2 SDK Playing VP8 encoded webm format video, on Android 13, the video screen is unclear and appears blurred HOT 2
- Fire stick 4k max 1st gen and 2nd gen BUG with DV + HDR content (split screen OR only blackscreen with audio) HOT 3
- Built-in mute/unmute button for ExoPlayer similar to YouTube home tab HOT 2
- Select subtitles track from the start in media demo app HOT 2
- Multiple MediaItems Play HOT 2
- README for extensions (FFMPEG) is not clear HOT 2
- Pressing Play/Pause button twice on remote devices triggers Command_Seek_To_Next HOT 11
- Media (video + audio) is not playing on some high-end devices (Pixel, S22) HOT 1
- Notification Image Not Updating HOT 1
- java.io.IOException: bt socket closed, read return HOT 3
- Video Track EXCEEDS_CAPABILITIES on media3 v1.2.0 but not in exoplayer v2.17.0 HOT 4
- Different Colors in Transparent, BitmapOverlay in Media Transformer HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from media.