android - Android - 仅大屏幕手机的VideoView无法播放此视频”

每当我尝试通过手机在应用中流式传输实时视频时,我都会收到"Can't play this video"的消息


 getWindow().setFormat(PixelFormat.TRANSLUCENT);


 MediaController mediaController = new MediaController(this);


 mediaController.setAnchorView(videoView);



 // Parse Url as uri



 String StreamingLink="http://195.154.240.109:8888/live/Test/Test/1.ts";



 Uri videoUri = Uri.parse(StreamingLink);



 // set Media Controller to video view


 videoView.setMediaController(mediaController);


 //set Video Uri


 videoView.setVideoURI(videoUri);


 videoView.requestFocus();


 videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {


 @Override


 public void onPrepared(MediaPlayer mediaPlayer) {



 pd.dismiss();


 videoView.start();


 }


 });



 }catch (Exception e){


 pd.dismiss();



 e.printStackTrace();


 }


}`



时间:

问题可能与大屏幕无关,但是更新的android版本默认不允许https请求,尝试将此属性添加到应用程序清单中的application部分:


android:usesCleartextTraffic="true"



查看这里以获取更多详细信息

...