开发者

when i run app it's show the error video can't play sorry this video can't be played

package com.video;

import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.Window;
import android.widget.MediaController;
import android.widget.VideoView;

public class video extends Activity {
/** Called when the activity is first created. */
//  String LINK = "http://www.ted.com/talks/download/video/8584/talk/761";
//this is direct youtube url.. which i want to play
String LINK = "http://www.youtube.com/watch?v=Dff1wa-po5k&feature=topvideos_music";

    public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    this.setContentView(R.layout.main);

    fina开发者_JS百科l MyCount counter = new MyCount(5000, 1000);
    counter.start();

    // final ImageView imageview = (ImageView) this.findViewById(R.id.ImageView01);
    // imageview.setImageResource(R.drawable.index);

    final VideoView videoView = (VideoView) this.findViewById(R.id.videoview01);
    final MediaController mc = new MediaController(this);
    mc.setAnchorView(videoView);
    mc.setMediaPlayer(videoView);

    final Uri video = Uri.parse(this.LINK);
    videoView.setMediaController(mc);
    videoView.setVideoURI(video);
    videoView.start();
}

public class MyCount extends CountDownTimer {

    public MyCount(final long millisInFuture, final long countDownInterval) {
        super(millisInFuture, countDownInterval);
        // TODO Auto-generated constructor stub
    }
    public void onFinish() {
        // TODO Auto-generated method stub
    }
    public void onTick(final long arg0) {
        // TODO Auto-generated method stub

    }

}

}


First of all please format you source correctly the next time you ask. And for your problem: I think the issue happens because you're trying to play back an flash video (YouTube). This throws an error because Android has now standard flash player installed. You can try to open the video with an intent and using the YouTube app.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜