简体   繁体   English

Android:抱歉,此视频无法在videoview中播放

[英]Android: Sorry this video can not be played in videoview

I know there are many questions and answer on this, but I went through all, but I could not find any solution, and its almost two months I am again and again encountering this issue of "Sorry this video can not be played". 我知道对此有很多疑问和答案,但是我经历了所有问题,但找不到任何解决方案,在将近两个月的时间里,我一次又一次遇到“抱歉,无法播放此视频”的问题。

Here is my xml file 这是我的xml文件

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
 >

<VideoView
    android:id="@+id/booksanimation"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    />
</RelativeLayout>

Here is my code.. 这是我的代码。

    getWindow().setFormat(PixelFormat.TRANSLUCENT);
    videoview = (VideoView) findViewById(R.id.booksanimation);
    videoview.setVideoURI(Uri.parse("android.resource://com.d4sys.sabaq/" + R.raw.booksanimation));
    videoview.setMediaController(new MediaController(this));
    videoview.requestFocus();
    videoview.start();

I do not know what are the problems, sometimes when i place another video with different resolution, that video is played but not all videos are played.. If some video is playing on Tablet, it does not play on small devices,, what are the issues? 我不知道出了什么问题,有时当我放置另一个分辨率不同的视频时,该视频会播放,但并非所有视频都播放。如果某些视频在Tablet上播放,则无法在小型设备上播放,问题?

Have you check the video format? 您检查视频格式了吗? Not all format supported natively by Android I face similar problem before and in the end i change all mov to mp4 并非Android本机支持的所有格式我最终都会遇到类似的问题,最终我将所有mov更改为mp4

http://developer.android.com/guide/appendix/media-formats.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM