1

我有以下代码来显示适用于 iOS 的钛合金 youtube 视频。

var win = Titanium.UI.createWindow();


// Set the window orientation modes for the video to rotate with the device
win.orientationModes = [ Ti.UI.PORTRAIT, Ti.UI.LANDSCAPE_LEFT,
                     Ti.UI.LANDSCAPE_RIGHT ];

win.open();

// Build the movie URL. 'fs' and 'autoplay' parameters are optional.
var movieId = "oYgMRIIVX3w";
var movieUrl = "http://www.youtube.com/embed/" + movieId+ "?fs=1&autoplay=1";
webview = Ti.UI.createWebView({
url : movieUrl
});

win.add(webview);

但是,即使使用“autoplay=1”,youtube 视频仍然不会自动播放。用户仍然需要点击 youtube 中的播放按钮。

关于如何在不点击播放按钮的情况下自动播放 youtube 的任何想法?

谢谢。

4

0 回答 0