My goal is to play media from stream, not from file, because I don’t know entire file size and won’t to download unknown amount of data into the memory buffer, but play on the fly (e.g. let some Gio driver do this job with chunks cleanup, etc).
Here I found following widget:
Not sure it’s good choice for audio (as can’t find special widget for this mime)
anyway, my code in Rust now looks like:
let media_file = MediaFile::for_input_stream(&connection.input_stream());
let media_stream = MediaStream::from(media_file);
let video = Video::for_media_stream(Some(&media_stream));
// then append video somewhere..
Thoughts how does it work: is it reading entire file from input_stream
to media_stream
somewhere in memory or pass the bytes to the video widget directly?
How can I play data without loading?
It’s my first experience, trying to make media playback for browser