我正在尝试使用浏览器实例通过EMBED代码播放YouTube视频。
You can find my sample project here。
视频播放器加载正常,但是当我单击“播放”时,音频通过了,但是图像保持黑色。
谁能建议出什么问题了? (理想情况下,我也希望最终也能在移动设备上使用)。下面提供的代码。
########### LIVECODE
global sBrowserId
on mouseUp
repeat for each item theItem in revBrowserInstances()
revBrowserClose theItem
end repeat
altBrowserOn
end mouseUp
on altBrowserOn
put empty into tAddress
put field "soundcloud" into PAGINAHTML
-- We pass the windowId of the stack to revBrowser
put the windowid of this stack into tWinID
-- Open the browser, using the windowId and initial url
put revBrowserOpen(tWinID,tAddress) into sBrowserId
revBrowserSet sBrowserId, "htmltext", PAGINAHTML
if sBrowserId is not an integer then
answer "Error opening browser: " & sBrowserId
exit altBrowserOn
end if
-- Set some basic properties for the browser
revBrowserSet sBrowserId, "showborder","true"
revBrowserSet sBrowserId, "scrollbars","false"
revBrowserSet sBrowserId, "useragent", "Mozilla/5.0 ;iPhone; CPU iPhone OS 7_1_2 like Mac OS X; AppleWebKit/537.51.2 ;KHTML, like Gecko; Version/7.0 Mobile/11D257 Safari/9537.53"
put the rect of field "soundcloud" of this card into tRectImage
revBrowserSet sBrowserId, "rect", tRectImage
end altBrowserOn
on altBrowserOff
if sBrowserId is an integer then
revBrowserClose sBrowserId
end if
end altBrowserOff
####### END LIVECODE
####### EMBED CODE
<html>
<head><title></title>
</head>
<body>
<iframe width="420" height="315" src="https://www.youtube.com/embed/56G8tuyez5s" frameborder="0" allowfullscreen></iframe>
</body>
</html>
########## END EMBED CODE
最佳答案
LC浏览器的问题之一是它没有安装h264编解码器。 YouTube的某些视频是使用此编解码器编码的,与Vimeo相同。唯一的办法就是建立自己的CEF。
关于browser - 以Livecode播放YouTube视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33237959/