在 ASP.NET MVC 网站上嵌入视频

发布于 2024-11-26 16:14:51 字数 256 浏览 3 评论 0原文

我使用 Flash 创建了一个 SWF 文件,该文件在我的本地开发计算机上加载 FLV 文件。当发布 SWF 文件并生成相应的 HTML 时,我可以通过打开 Flash 创建的生成的 HTML 页面来成功加载视频。但是,当将生成的 HTML 代码放入我的视图中时,Flash 正在加载,但视频未播放。我认为这是对 FLV 文件位置的引用错误,但我已经尝试了我能想到的所有组合。我将SWF和FLV放在我想要加载视频的相应View文件夹中,但无济于事。有人有我可以看的工作示例,或者有什么建议吗?谢谢。

I have created a SWF file using Flash that loads an FLV file on my local development machine. When publishing the SWF file and generating the appropriate HTML, I can successfully load the video by opening the generated HTML page that Flash creates. However, when placing the generated HTML code in my View, the Flash is loading, but the video is not playing. I think it's a reference error to the location of the FLV file, but I've tried every combination I can think of. I placed the SWF and FLV in the corresponding View folder where I want the video to load, but to no avail. Does anyone have a working example that I can look at, or any suggestions? Thanks.

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

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

发布评论

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

评论(2

阳光的暖冬 2024-12-03 16:14:51

我认为这是对 FLV 文件位置的引用错误,但我已经尝试了我能想到的所有组合。

是的,我也这么认为。您是否尝试过使用 Url 帮助程序来引用站点上的静态资源,例如

@Url.Content("~/Content/Videos/MySupervideo.flv")

I think it's a reference error to the location of the FLV file, but I've tried every combination I can think of.

Yes, I think so as well. Have you tried using Url helpers to reference static resources on your site, like

@Url.Content("~/Content/Videos/MySupervideo.flv")
余厌 2024-12-03 16:14:51

对我来说,实际的解决方案是这样的...

在您的 Flash 文件中,组件检查器应该指向 Web 服务器上 FLV 文件所在的位置...

发布 SWF,将相应的 HTML 复制到您的视图中希望视频能够在...中播放,

正如 Darin 所指出的,使用帮助程序在您的 Web 服务器上写入 SWF 文件所在的路径。唯一的区别是这个(我发现使用谷歌的“检查元素”功能,然后单击“网络”项,然后单击左侧加载的“SWF”路径...右侧显示 404 Status Not发现...为什么?

@Url.Content("~/Content/video/name-of-swf.swf") actually produced 
src='http://localhost/content/video/name-of-swf.swf.swf'

这显然是不正确的...所以这是使用助手的正确方法...

@Url.Content("~/Content/video/name-of-swf")

希望这可以帮助某人...我给予达林信任,因为他把我推向了正确的方向...

The actual solution to this for me was this...

In your Flash file, the Component Inspector should point to the location on the web server where the FLV file is located...

Publish the SWF, copy the appropriate HTML to the View you would like the video to play in...

And just as Darin has pointed out, use the Helpers to write the path to the SWF file on your web server where it is located. The only difference is this (which I discovered using Google's 'Inspect Element' feature and then clicking on the 'Network' item, then clicking the path loaded on the left for the 'SWF'... on the right it stated 404 Status Not Found... why?

@Url.Content("~/Content/video/name-of-swf.swf") actually produced 
src='http://localhost/content/video/name-of-swf.swf.swf'

This obviously incorrect... so here is the correct way to use the Helpers...

@Url.Content("~/Content/video/name-of-swf")

Hope this helps someone... I am giving Darin credit because he pushed me in the right direction...

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