无法播放Youttube影片 [英] Unable to play Youttube Videos

查看:279
本文介绍了无法播放Youttube影片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请看看他下code

private class IntroVideoHandler implements OnClickListener
    {

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            MediaPlayer mp = new MediaPlayer();
            try {
                mp.setDataSource("http://www.youtube.com/watch?v=Cb7QJwQ58T0");
                mp.prepareAsync();
                mp.start();
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } 


        }

在这里,我无法无论是在模拟器或手机播放YouTube视频。我收到以下错误

Here, I am unable to play the youtube video either in simulator or phone. I get the following error

08-22 14:34:47.176: E/MediaPlayer(471): start called in state 4
08-22 14:34:47.176: E/MediaPlayer(471): error (-38, 0)
08-22 14:34:47.306: E/MediaPlayer(471): Error (-38,0)
08-22 14:34:56.426: E/MediaPlayer(471): error (1, -2147483648)
08-22 14:34:56.426: E/MediaPlayer(471): Error (1,-2147483648)

这是为什么?请帮助。

Why is this? Please help.

推荐答案

看到这个 API

您不能在视频鉴于这种方式直接播放YouTube视频..你有以下选项来播放它。

You can not play youtube video directly in video view this way.. you have below option to play it.

1)装载的网址,网页流量

1) load this url in webview

2)通过YouTube视频ID到YouTube应用程序。

2) pass youtube video id to youtube application.

3)视频ID获得RTSP URL和videoView发挥

3) get RTSP url from video id and play in videoView

这篇关于无法播放Youttube影片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆