【问题标题】:when i run app it's show the error video can't play sorry this video can't be played当我运行应用程序时,它显示错误视频无法播放抱歉,此视频无法播放
【发布时间】:2011-04-26 07:36:31
【问题描述】:
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);

    final 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

    }

}

}

【问题讨论】:

    标签: android youtube video-capture


    【解决方案1】:

    首先,请在您下次询问时正确格式化您的来源。对于您的问题:我认为问题的发生是因为您正在尝试播放 Flash 视频 (YouTube)。这会引发错误,因为 Android 现在已安装标准 Flash 播放器。您可以尝试使用 YouTube 应用打开视频。

    【讨论】:

      猜你喜欢
      • 2013-12-04
      • 1970-01-01
      • 2011-09-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多