Can YouTube be embedded in Android Applications? How about WebOS or Blackberry?
Asked Answered
P

3

2

Can YouTube videos be played from within an AndroidOS without launching the separate YouTube player? How about WebOS or Blackberry?

On the iPhone I can do this with a WebView and the embedded YouTube code and I'm weighing the possibility of porting my app to other mobile platforms. Thanks

Pizzicato answered 15/4, 2010 at 13:57 Comment(0)
H
0

Yes. webview.setPluginsEnabled(true);

Hanson answered 15/4, 2010 at 13:59 Comment(0)
P
1

You can launch the webOS YouTube player from your app in a separate card using code like:

launchYouTube: function(mediaURL)
{
  var params = {
    target: mediaURL,
    direct: true
  };
  this.controller.serviceRequest('palm://com.palm.applicationManager', {
    method:'launch',
    parameters: {
      'id': 'com.palm.app.youtube',
      'params': params
  });
}

The mediaURL parameter looks like "http://www.youtube.com/watch?v=_6U9YGDtSEs" depending on the video.

As best I can tell, the YouTube player does not support the sublaunch mechanism that allows it to be embedded as a new scene on your own app's stage.

Phyla answered 15/4, 2010 at 15:47 Comment(1)
can you explain what you mean about the mediaURL para? Is it like mediaURL = "http://www.youtube.com/watch?v=_6U9YGDtSEs",Demonetize
H
0

Yes. webview.setPluginsEnabled(true);

Hanson answered 15/4, 2010 at 13:59 Comment(0)
C
0

setPluginsEnabled is now deprecated, new method:

webView.getSettings().setPluginState( WebSettings.PluginState.ON );
Courtland answered 29/3, 2011 at 14:46 Comment(1)
This is deprecated starting in API 18Efficacy

© 2022 - 2024 — McMap. All rights reserved.