1

YouTube 動画を自分のページに追加したいと考えています。ビデオをダウンロードして、res-> raw フォルダーに追加しました。ビデオは minecraft_trailer.mp4 とマークされています。JavaScript ページでエラーが発生しましたが、それが何であるかわかりません。助けてください。

package com.treacheryofimages.www;

import android.app.Activity;
import android.os.Bundle;
import android.widget.VideoView;

public class OtherActivity7 extends Activity {

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

    VideoView vv = (VideoView)this.findViewById(R.id.videoView1);
    String fileName = "android.resource://" + getPackageName() + "/" + 
    R.raw.minecraft_trailer;
    vv.setVideoURI(Uri.parse(minecraft_trailer));
    vv.start();
  }
}

エラーは vv.setVideoURI(Uri.parse(minecraft_trailer)); から来ています。ライン

それが何であるかはわかりません。() の中にある可能性があります。また、それらの () の中に何が入るはずですか

4

2 に答える 2

0

minecraft_trailer呼び出すときに間違った変数を渡していますvv.setVideoURI();

そのはずvv.setVideoURI(Uri.parse(fileName ));

于 2013-02-12T01:11:39.590 に答える