-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build MediaSource from InputStream (without any Uri) #4149
Comments
Hi, could you clarify why implementing your own Extractor is not enough? If your binary format is just a stream of bytes, then I am inclined to think that's the way to go. Implementing a media source is an overkill. On the other hand, the DataSource allows you to implement a custom way to fetch the bytes, so it should work with any media format: custom or not.
Could you clarify what this means?
Yes, you need both a Uri and a DataSource. You need a Uri to create the DataSpec that the DataSource takes through open(). In any case, implementing a media source is not different from implementing any other interface. From your description of the issue, the ExtractorMediaSource should fit well, since there is no adaptation going on. So if you are sure you cannot use ExtractorMediaSource with your own implementation of Extractor, then using it as a base is the way to go, in my opinion. |
Closing due to lack of activity. |
@petersamokhin: I have the same requirement - to play media from encrypted container (local or cloud). Do you have any progress with your task? P.S.:
Я подозреваю, что нужно реализовать свой |
@AquilesCanta: Is it possible to play media from |
@isabsent you can use your own wrapper of ExoPlayer's Напишите свой враппер над Все имплементации Вам нужно просто переопределить метод |
@petersamokhin: Can you share the code of
|
@isabsent I don't made |
Я понимаю и делал все это для
|
I'm working with own binary format. Some parts of this file contains bytes of media files. I can't "extract" them and provide
Uri
toExoPlayer
(it works, but it impractical).Also I can't read all these parts to memory and provide byte array to
ExoPlayer
(and there no ability to do this too, because I sawByteArrayDataSource
, but can't create anyMediaSource
from this).I created my
InputStream
that providing fixed count of bytes from necessary offset of file (without reading all file to memory). Also I createdInputStreamDataSource extends DataSource
, that using myInputStream
.So question is, how to create
MediaSource
that will use myDataSource
? AllMediaSource
implementations requiresUri
.The text was updated successfully, but these errors were encountered: