How to stream video across LAN in android VideoView

前端 未结 2 823
清歌不尽
清歌不尽 2021-02-10 16:22

Due to office constraints I have a LAN network without internet and have to stream a video into my android application.

I can view the video in ES Explorer on the device

2条回答
  •  梦如初夏
    2021-02-10 16:49

    I've been able to play smb:// shares over the network in a VideoView by:

    • Using JCIFS to scan for and "see" the share: http://jcifs.samba.org/

    • Implementing a simple HTTP server (NanoHttpd) to stream the content via http: https://github.com/NanoHttpd/nanohttpd

    • Passing the http://localhost/myvideo link to the VideoView

    I realise this seems convoluted (and I agree) but it's the only way I've managed to get it working (and working well, with seeking, etc.). I'd be interested if there are better solutions.

提交回复
热议问题