在安全页面上嵌入不安全的 Flash 对象
我想知道是否可以在 https 网站上嵌入 YouTube 视频。据我所知,YouTube 视频只能使用 http://
协议嵌入。有没有办法将它们嵌入到页面上,而 Firefox 不会抛出错误?
I am wondering if it is possible to embed a YouTube video on a https website. As far as I can tell YouTube videos can only be embedded with the http://
protocol. Is there a way to embed them on a page without Firefox throwing an error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我真的不知道这是否有效,但你应该尝试一下:
在播放视频之前,您必须调用 Youtube API 接收视频源:
http://gdata.youtube.com/feeds/api/videos/VideoID
让您的玩家流式传输此视频。
在您的播放器中,您应该能够允许从安全网站接收不安全的内容。您可能需要阅读一下 Flash Player 安全沙箱 。
I really do not know if this works, but you should give it a try:
Before you play a video you have to call the Youtube API the recieve the source of you video:
http://gdata.youtube.com/feeds/api/videos/VideoID
Get you player streaming this video.
Within your player you should be able to allow recieving unsecure content from a secured website. You probably have to a little bit reading on the Flash Players security sandbox.
不幸的是,Youtube 的网站主要部分没有安装有效的 SSL 证书。您可以尝试使用代理,例如 https://browseunblocked.com/
Unfortunately, Youtube doesn't have a valid SSL certificate installed on the main part of its site. You can try using a proxy such as https://browseunblocked.com/
由于 YouTube 没有有效的 SSL 证书,因此这是不可能的。也许您可以在 https 网页中嵌入包含 YouTube 视频的 HTTP iFrame?通过 SSL 传输视频的速度会很慢,因此除非视频本身需要加密,否则不应使用它。既然您谈论的是流式传输 YouTube 视频,我怀疑您是否关心加密实际的视频流,而只是关心观看它的请求。
Since Youtube doesn't have a valid SSL certificate, this won't be possible. Perhaps you could instead embed a HTTP iFrame containing a YouTube video inside your https webpage? Streaming a video over SSL would be slow, so unless the video itself needs to be encrypted, you shouldn't use it. Since you're talking about streaming YouTube videos, I doubt you care about encrypting the actual video stream, just the request to view it.
您可以通过安全服务器代理 YouTube 流。我的意思是有一个中间层应用程序,它从 YouTube 获取视频源,并通过安全连接将其传递回 Flash 应用程序。
You could proxy the youtube stream through a secure server. What I mean is have a middle tier application that fetches the video feed from youtube and passes it through a secure connection back to your flash app.