在 Adob​​e AIR 应用程序中播放 YouTube 视频的选项

发布于 2024-07-27 17:10:50 字数 633 浏览 4 评论 0 原文

我正在尝试将 YouTube 内容放入 Flex 3 AIR 应用程序中,并尝试了使用 TubeLoc、包装器 as3 类的多种选项,但似乎都不起作用。

最近,我一直在尝试在 http://www.blackcj 找到的方法。 com/blog/tag/youtube/,但仍然遇到代码无法在 test.html 中找到 ytplayer 的问题。 一直绞尽脑汁试图弄清楚它应该去哪里,但没有运气。

还尝试使用 SWFLoader 组件,但也没有运气......基本上,我一直在尝试像这样使用它:

<mx:SWFLoader id="player2" source="http://www.youtube.com/swf/l.swf?video_id=xx" autoLoad="true" showBusyCursor="true" width="346" height="194" x="20" y="35"/>

但也没有运气。

有谁有我可以遵循的任何文章或明确的步骤来尝试使其正常工作吗?

I'm trying to get YouTube content into a Flex 3 AIR application and have tried a number of options using TubeLoc, wrapper as3 classes which all seem to not work.

Most recently, I've been trying the method I found at http://www.blackcj.com/blog/tag/youtube/, but still having difficulties with the code not being able to find ytplayer in the test.html. Have been wracking the brains trying to figure out where it should go but no luck.

Also tried to use an SWFLoader component, but no luck with it either... Basically, I've been trying to use it like this:

<mx:SWFLoader id="player2" source="http://www.youtube.com/swf/l.swf?video_id=xx" autoLoad="true" showBusyCursor="true" width="346" height="194" x="20" y="35"/>

but no luck with that either.

Does anyone have any articles or clear steps I can follow to try and get this working?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

兲鉂ぱ嘚淚 2024-08-03 17:10:50

我在 Adob​​e Air 应用程序中使用 tubeloc 播放 YouTube 视频,但它有一些错误,这让我寻找替代方案,这导致我提出你的问题和 您建议的链接

它对我来说非常有用。 它要简单得多,特别是如果您只需要播放一个视频(或某些视频)。

关于您的问题:

但仍然遇到代码无法在 test.html 中找到 ytplayer 的问题。 一直绞尽脑汁试图弄清楚它应该去哪里,但没有成功。

每当 HTML 文件中出现问题时,我都会遇到这种情况。 确保内部的 JavaScript 合成正确并且 HTML 本身格式正确。

另外,如果您要在项目中导入这些类,请不要忘记 js 文件夹。 我这样做了,这就是同样错误的原因。

如果您需要的不仅仅是播放/暂停视频,您可以通过查看 YouTube API本身。 实际上,这很简单。

无论如何,感谢您提供该链接,我希望您也能使其正常工作。 :)

I was using tubeloc to play YouTube video inside my Adobe Air application but it has some bugs which made me look for alternatives, which led me to your question and the link you suggested.

It has served me perfectly well. It's a lot simpler, specially if all you need is to play a video (or some videos).

About your issue:

but still having difficulties with the code not able to find ytplayer in the test.html. Have been wracking the brains trying to figure out where it should go but no luck.

It has happened to me whenever I had something wrong inside the HTML file. Make sure that the JavaScript synthax inside is correct and that the HTML itself is well formed.

Also, if you're importing those classes inside your project, don't forget that js folder. I did, and that was a reason for the same error.

If you need more than just play/pause a video, you can extend it's funcionality by taking a look at the YouTube API itself. It's quite simple, actually.

Anyways, thanks for providing that link and I hope you get it to work too. :)

多情出卖 2024-08-03 17:10:50

使用 YouTube chromeless 播放器,它是为嵌入 YouTube 视频而制作的

http://code.google.com /apis/youtube/chromeless_player_reference.html

use the youtube chromless player it was made for embedding youtube videos

http://code.google.com/apis/youtube/chromeless_player_reference.html

痕至 2024-08-03 17:10:50

好吧,看来通过 HTML 加载嵌入式 YouTube 播放器在我的 AIR 应用程序中不起作用,因为主应用程序配置启用了透明度。

这是 AIR 框架中的一个错误,它无法正常工作。 显然,HTMLOverlay 可用于在应用程序顶部放置一个窗口,但这对我来说就像是一个相当令人讨厌的黑客攻击。

Well, it seems that loading up the embedded YouTube player via HTML just won't work in my AIR application as the main application configuration has transparency enabled.

This is a bug in the AIR framework and it's just not going to work. Apparently an HTMLOverlay can be used to position a window on top of your application, but this smells like a fairly nasty hack to me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文