Play video in Android from a bytes stream

前端 未结 1 1566
[愿得一人]
[愿得一人] 2021-02-14 17:34

Is there any way to play a video from a bytes stream in Android? I\'m using an specific communications middleware so I can\'t just pass the http/rtsp link to the MediaPlayer obj

1条回答
  •  再見小時候
    2021-02-14 17:36

    Custom streaming in Android isn't as easy as I thought. I've managed to do it but only with very specific videos. MPEG4 Videos that are poorly interleaved seem to be streamable. The farest I've gotten is streaming this video:

    http://www.pocketjourney.com/downloads/pj/video/famous.3gp

    As Cipi answered me, most formats cannot just be packed in a bytes buffer and pass it to MediaPlayer. They need some headers, tails, etc. I'm not sure which format is contained within the aforementioned file, but I guess it's MPEG4.

    0 讨论(0)
提交回复
热议问题