小编luc*_*ucy的帖子

Android Help:如何打开远程视频文件URL以在MediaPlayer中播放而无需打开浏览器窗口?

如何从按钮单击打开远程视频文件URL以在内部MediaPlayer中播放而无需打开浏览器窗口?

视频播放正常,但它总是打开浏览器窗口1,这很烦人.

这就是我已经使用的,但是可以在没有应用程序首先打开浏览器窗口的情况下启动媒体播放器.

希望有人能提供帮助

谢谢露西

final Button button = (Button) findViewById(R.id.play);  
     button.setOnClickListener(new Button.OnClickListener() {  
         public void onClick(View v) {  
             // Perform action on click 
             Uri uri = Uri.parse("http://domain.com/videofile.mp4");
             Intent intent = new Intent(Intent.ACTION_VIEW, uri);

             startActivity(intent);

            }

     });  
 }  
Run Code Online (Sandbox Code Playgroud)

android media-player

11
推荐指数
3
解决办法
1万
查看次数

标签 统计

android ×1

media-player ×1