开发者

not able to play video in the emulator

开发者 https://www.devze.com 2023-03-01 20:51 出处:网络
public class VideoViewActivity extends Activity { private String vSource; @Override protected void onCreate(Bundle savedInstanceState) {
public class VideoViewActivity extends Activity {
    private String vSource;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);

              setContentView(R.layout.videoviewacti);
              VideoView vView = (VideoView)findViewById(R.id.videovw);
              vView.requestFocus();
              String LINK = ConstantData.urlVideo;
              Log.i("path of video",""+LINK);
              vView.setVideoURI(Uri.parse(LINK));

              //vView.setVideoPath("sdcard/test30fps.mp4");
              MediaController mediacontroller = new MediaController(this);
              vView.setMediaController(mediacontroller);
              vView.start();
    }
}

here the video doesn't play开发者_运维技巧 in the emulator.It shows the error like "Can not play video" video format is mp4 on the webservice. when it opens the video file then the controls of the mediaplayer get disabled.

0

精彩评论

暂无评论...
验证码 换一张
取 消