2017-06-10 15 views
0

ビデオビューでビデオを再生しようとしていますが、再生できません。ここ
は私のJavaコードは次のとおりです。VideoView「このビデオを再生できません」

package com.ggblbl.videoView; 

import android.net.Uri; 
import android.os.Bundle; 
import android.support.v7.app.AppCompatActivity; 
import android.widget.VideoView; 

public class RandomVideoBlueActivity extends AppCompatActivity { 

    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_random_video_blue); 

     VideoView videoBlue = (VideoView) findViewById(R.id.videoViewBlue); 
     String videoPathBlue = "android.resource://"+getPackageName()+"/"+R.raw.blue_video; 
     Uri videoUriBlue = Uri.parse(videoPathBlue); 
     videoBlue.setVideoURI(videoUriBlue); 
     videoBlue.start(); 
    } 
} 

マイビデオ名がvideo_blue.mp4です。私は私のLG L70(D320n)上でそれをテストしてみた

<?xml version="1.0" encoding="utf-8"?> 
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="com.ggblbl.videoView.RandomVideoBlueActivity"> 

    <VideoView 
     android:id="@+id/videoViewBlue" 
     android:layout_width="0dp" 
     android:layout_height="0dp" 
     android:layout_marginBottom="8dp" 
     android:layout_marginLeft="8dp" 
     android:layout_marginRight="8dp" 
     android:layout_marginTop="8dp" 
     app:layout_constraintBottom_toBottomOf="parent" 
     app:layout_constraintLeft_toLeftOf="parent" 
     app:layout_constraintRight_toRightOf="parent" 
     app:layout_constraintTop_toTopOf="parent" /> 
</android.support.constraint.ConstraintLayout> 


https://www.dropbox.com/s/iefnweekgbb9owz/blue_video.mp4?dl=0

は、ここに私の活動のXMLです。
モトローラMoto G1では動作しますが、

答えて

0

私はいくつかのテストを行っており、ビデオの解像度が私の貧しい古い電話のために高すぎるようだ... 私はすべての電話のためにそれを縮小する方法を見つける必要がありますね。

関連する問題