YouTube video within a WebView: works on a 3.1 tablet, but not on 3.1 Logitech Revue

196 views
Skip to first unread message

BoD

unread,
Dec 18, 2011, 3:57:48 PM12/18/11
to googletv...@googlegroups.com
Hi!

I am trying to make an app that displays a WebView showing an YouTube video.
The code is pretty straightforward:

public class TestvideoActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        final WebView webView = (WebView) findViewById(R.id.webView);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.setWebChromeClient(new WebChromeClient()); // don't ask
        webView.loadUrl("http://jraf.org/static/tmp/html3.html");
    }
}

And the contents of the html3.hml file is:
<html>
<body>
Hello
<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/B8WHKRzkCOY" frameborder="0">
</iframe>
</body>
</html>

Unfortunately on my Logitech Revue with the 3.1 update, I don't see any video, although the sound is playing.
On an Android tablet running 3.1 (also tried 3.2) this works as expected.

I also tried with a simple html file containing a <video> tag, the problem was the same (sound but no video).

Any help on this problem would be much appreciated!

As a side note: isn't there a bug tracker for GoogleTV specific issues?

Thanks a lot!

--
BoD

Les Vogel

unread,
Dec 18, 2011, 6:41:13 PM12/18/11
to googletv...@googlegroups.com
True for v2.0.
--
Developer Programs Engineer - GoogleTV


Please send questions to the list and only use my email address for things that require privacy such as source code or APK's.   We also answer questions on StackOverflow.com  #Google-TV

BoD

unread,
Dec 19, 2011, 6:04:58 AM12/19/11
to googletv...@googlegroups.com
Thank you for replying.
However, could you elaborate? :)
First of all what do you mean by v2.0?  Does that refer to the latest Android 3.1 based update?  Because the problem occurs on this version.

Thanks a lot,

--
BoD

BoD

unread,
Dec 19, 2011, 3:38:42 AM12/19/11
to googletv...@googlegroups.com

Les Vogel

unread,
Dec 19, 2011, 10:26:59 AM12/19/11
to googletv...@googlegroups.com
GoogleTV v2.0 is based on Android 3.1.

Les

BoD

unread,
Dec 19, 2011, 11:50:33 AM12/19/11
to googletv...@googlegroups.com
Thank you very much.
So you confirm that this indeed doesn't work.
Do you know if there is a workaround, a fix in the works and/or an issue ticket opened somewhere that I could follow?
Please note that since it is also (apparently) impossible to use Flash in a WebView with GoogleTV, this issue is blocking for us, and anybody wanting to make an app around YouTube.

Thanks a lot for your support,

--
BoD

Les Vogel

unread,
Dec 19, 2011, 12:56:55 PM12/19/11
to googletv...@googlegroups.com
You can either:

1) Fire off an intent to Chrome
2) Create a transparent videoView over your webView, and send a JS message to Java code that activates it when you want to play.  (Of course you won't get highres video that way from YT).
3) Contact someone on our BD team.

Les

BoD

unread,
Dec 19, 2011, 1:12:38 PM12/19/11
to googletv...@googlegroups.com
Thanks for your reply.
Unfortunately solution 1 is not good in our case as we want to have an 'integrated' user experience.
I don't think solution 2 would work or maybe I'm missing something, but in the case of YouTube we don't have access to the stream of the video. So a VideoView cannot be used.
I'm sorry, I don't understand solution 3 (who are the BD team, and how do I contact them?)

Again, thanks for the support!

--
BoD
Reply all
Reply to author
Forward
0 new messages