Browser 在Livecode中播放YouTube视频

Browser 在Livecode中播放YouTube视频,browser,youtube,livecode,Browser,Youtube,Livecode,我正在尝试使用一个浏览器实例来使用嵌入代码播放YouTube视频 视频播放器加载正常,但当我单击“播放”时,音频会通过,但图像仍为黑色 有人能告诉我出了什么问题吗?理想情况下,我最终也会喜欢在手机上工作。代码如下所示 ########### LIVECODE global sBrowserId on mouseUp repeat for each item theItem in revBrowserInstances()       revBrowserClose theItem    

我正在尝试使用一个浏览器实例来使用嵌入代码播放YouTube视频

视频播放器加载正常,但当我单击“播放”时,音频会通过,但图像仍为黑色

有人能告诉我出了什么问题吗?理想情况下,我最终也会喜欢在手机上工作。代码如下所示

########### 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。

找到了。模仿我的Chrome浏览器用户代理做的。。。Mozilla/5.0 Macintosh;英特尔Mac OS X 10_10_4 AppleWebKit/537.36 KHTML,像Gecko Chrome/45.0.2454.101 Safari/537.36抱歉!不,那还没修好。刚刚有一段视频。再次非常抱歉。我将代码和对象复制到一个新的堆栈中,它就可以正常工作了。我怀疑记忆在某个时候被弄乱了。它现在同时播放YouTube和Soundcloud嵌入代码。