[英]Android: Sorry this video can not be played in videoview
我知道對此有很多疑問和答案,但是我經歷了所有問題,但找不到任何解決方案,在將近兩個月的時間里,我一次又一次遇到“抱歉,無法播放此視頻”的問題。
這是我的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>
這是我的代碼。
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();
我不知道出了什么問題,有時當我放置另一個分辨率不同的視頻時,該視頻會播放,但並非所有視頻都播放。如果某些視頻在Tablet上播放,則無法在小型設備上播放,問題?
您檢查視頻格式了嗎? 並非Android本機支持的所有格式我最終都會遇到類似的問題,最終我將所有mov更改為mp4
http://developer.android.com/guide/appendix/media-formats.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.