钛 youtube 视频自动播放
我有以下代码来显示 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 吗?
谢谢。
I have the following code to show youtube video in titanium for iOS.
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);
However, even use the "autoplay=1", the youtube video is still not playing automatically. User still need to click on the play button in youtube.
Any idea on how to play the youtube automatically without clicking the play button?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论