为什么不Android设备上播放所有的MP4视频吗? [英] Why not all mp4 videos played on Android device?

查看:261
本文介绍了为什么不Android设备上播放所有的MP4视频吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过Android设备上的视频,以播放以下两个URL,第一个一直很好,但第二个是行不通的。第二个需要5 SSL证书,但我不知道怎么玩它,当我试图发挥它出现错误code是:

  E / MediaPlayer的错误(1,-4)

我检查提到的错误codeS列表的链接,它说,错误(1,-4)表示NotSupportedFormat。那么,为什么这个错误不会出现在第一个环节虽然这两个视频链接.MP4

第一个工作链接:

  http://i250.photobucket.com/download-albums/gg264/APT08/APTAd3.mp4

第二个不工作的链接:

  HTTP://*********/xxxxxxxxxxxxxxxxxxxxx.mp4
  HTTPS://**********/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.mp4

注1:我问有关这有助于发挥的第一个环节,但第二次仍然没有工作在Android设备上的问题。

注2:我用下面的code打这两个链接:

  VideoView为myVideo =(VideoView)findViewById(R.id.videoView1);
         myVideo.setVideoPath(HTTPS://*********/bbbbbbbbbbbbbbbbbbb.mp4);
// myVideo.setVideoURI(Uri.parse(HTTPS://*************/bbbbbbbbbbbbbbbbbbbbbbbbb0.mp4));
    MC的MediaController =新的MediaController(本);
    mc.setMediaPlayer(为myVideo);
    myVideo.setMediaController(MC);
    myVideo.requestFocus();
    mc.show();


解决方案

我们没有为Android 3.0 HTTPS播放支持 -
仅从3.0及以上
 参考 http://developer.android.com/guide/appendix/media-formats。 HTML

I tried to play the following two urls by video view on Android device, the first one has worked fine but the second one is not working. the second one may needs ssl certificate but i don't know how to play it the error code appears when I am trying to play it is :

 E/MediaPlayer error (1, -4)

I checked a link that mentioned list of error codes and it said that error(1,-4) means NotSupportedFormat. So why this error doesn't appear in the first link although both videos links are .mp4

The first working link :

 http://i250.photobucket.com/download-albums/gg264/APT08/APTAd3.mp4 

The second not working link :

  http://*********/xxxxxxxxxxxxxxxxxxxxx.mp4
  https://**********/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.mp4

Note1: I asked a question related to this it helps to play the first link but the second still not working on android device

Note2: I am using the following code to play both links:

  VideoView myVideo = (VideoView) findViewById(R.id.videoView1);
         myVideo.setVideoPath("https://*********/bbbbbbbbbbbbbbbbbbb.mp4");
//       myVideo.setVideoURI(Uri.parse("https://*************/bbbbbbbbbbbbbbbbbbbbbbbbb0.mp4"));
    MediaController mc = new MediaController(this);
    mc.setMediaPlayer(myVideo);
    myVideo.setMediaController(mc);
    myVideo.requestFocus();
    mc.show();

解决方案

we dont have https playback support for android 3.0 - only from 3.0 and above refer http://developer.android.com/guide/appendix/media-formats.html

这篇关于为什么不Android设备上播放所有的MP4视频吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆