我正在使用经典的VideoView
实现在Android上播放视频。
相同的mp4文件网址在HTC Desire上运行正常。但它不适用于三星设备。
三星Galaxy S1和三星Galaxy Tab说:"Cannot play video. Unable to play video. Invalid streaming data"
三星5110说:"Cannot play video. Sorry this video is not valid for streaming to this device"
当我使用文本编辑器查看mp4文件时,我意识到 mdat 标记位于 moov 之前。
我的问题是它如何在HTC上运行,而在三星设备上却没有。而且我没有机会改变mp4文件的格式,那么我该如何克服这个问题?
07-29 15:24:21.740: ERROR/PlayerDriver(2402): PlayerDriver::it is a not Protected file
07-29 15:24:21.763: ERROR/(2402): IIIIIII Inside Constructor of PVMFMemoryBufferWriteDataStreamImpl
07-29 15:24:21.806: ERROR/MediaPlayerService(2402): Client::notify In
07-29 15:24:21.806: ERROR/(2402): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImpl
07-29 15:24:21.806: ERROR/(2402): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImpl
07-29 15:24:21.810: ERROR/MediaPlayer(15339): message received msg=3, ext1=0, ext2=0
07-29 15:24:21.810: ERROR/MediaPlayer(15339): callback application
07-29 15:24:21.810: ERROR/MediaPlayer(15339): back from callback
07-29 15:24:21.822: ERROR/(2402): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImpl
07-29 15:24:21.822: ERROR/(2402): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImpl
07-29 15:24:21.822: ERROR/MediaPlayerService(2402): Client::notify In
07-29 15:24:21.822: ERROR/MediaPlayer(15339): message received msg=200, ext1=1, ext2=26
07-29 15:24:21.822: ERROR/MediaPlayer(15339): callback application
07-29 15:24:21.822: ERROR/MediaPlayer(15339): back from callback
07-29 15:24:21.822: ERROR/PlayerDriver(2402): Command PLAYER_INIT completed with an error or info -82
07-29 15:24:21.822: ERROR/MediaPlayerService(2402): Client::notify In
07-29 15:24:21.822: ERROR/MediaPlayer(15339): message received msg=100, ext1=200, ext2=-82
07-29 15:24:21.822: ERROR/MediaPlayer(15339): error (200, -82)
07-29 15:24:21.822: ERROR/MediaPlayer(15339): callback application
07-29 15:24:21.826: ERROR/MediaPlayer(15339): back from callback
07-29 15:24:22.025: ERROR/MediaPlayer(15339): Error (200,-82)
答案 0 :(得分:3)
最后我发现了问题。
当我用mp4box暗示mp4文件时,它也在三星设备上播放。
mp4box -hint
此过程正确重新排列了视频文件的moov和mdat标记。
在此之前,同样的文件在使用android 2.3的设备上运行良好,但在使用android 2.2的设备上运行不正常。我不确定,但在2.3版本之后,“安全流媒体”的限制可能已被取消。