browser - 以Livecode播放YouTube视频

标签 browser youtube livecode

我正在尝试使用浏览器实例通过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/

相关文章:

javascript - 有没有办法让 "prevent"用户阻止浏览器上的确认框(firefox)

javascript - 检测浏览器是否在 Android 或 iOS 设备上运行

css - 全屏和音量按钮隐藏在 Swift 中的 youtubehelper 顶部栏后面

android - 在 Livecode 中,除了 hdpi 72x 之外,如何包含 Android 启动器图标大小?

android - 无法将 LiveCode 链接到 Android SDK

java 小程序在浏览器最新版本中被阻止

javascript - 使用javascript或jquery暂停youtube视频

java - JSON 数据错误地填充 textViews

livecode - 如何将 1 个文本框值连接到 url 中

javascript - 如何检测浏览器中是否安装了小书签?