solid-software/flutter_vlc_player

feature request: constructor for Socket, use input stream as source of video data

Opened this issue · 1 comments

I'm currently developing a flutter app that allows to view security live streams with RTSP protocol.
The proprietary APIs requires that, when the streaming has to be started, a TCP SecureSocket has to be created, using a certificate. Then, some bytes has to be sent as a command, and the server starts to responds packets until the socket is closed.

on native iOS, VLCMediaPlayer of MobileVLCKit pod allows to create such socket input:

VLCplayer.media = [[VLCMedia alloc] initWithStream:camera_to_stream._video_stream];

stream being an instance of NSInputStream

`
/**

  • Initializes a new VLCMedia object to use an input stream.
  • \note By default, NSStream instances that are not file-based are non-seekable,
  • you may subclass NSInputStream whose instances are capable of seeking through a stream.
  • This subclass must allow setting NSStreamFileCurrentOffsetKey property.
  • \note VLCMedia will open stream if it is not already opened, and will close eventually.
  • You can't pass an already closed input stream.
  • \param stream Input stream for media to be accessed.
  • \return A new VLCMedia object, only if there were no errors.
    */
  • (instancetype)initWithStream:(NSInputStream *)stream;
    `

On Android, using ExoPlayer, a similar approach can be done:

Uri tsVideoUri = Uri.parse("stream.ts"); DataSource.Factory pMyDataSourceFactory = () -> mDataSource; MediaSource pMyMediaSource = new ProgressiveMediaSource.Factory(pMyDataSourceFactory).createMediaSource(tsVideoUri);

mDataSource is an instance of a class that implements DataSource and makes use of a CircularByteBuffer, the data received from the socket is being written inside this data source.

Is this approach already available on flutter_vlc_player?

i have solution that return video from youtybe without know that video come from youtybe and all quality work and other function contact me on whatsapp:+971557474526