如何将 FLV 文件(存储在 HD 中)嵌入到我的 Web 应用程序中?

发布于 2024-11-14 18:54:47 字数 259 浏览 5 评论 0原文

我正在使用 C#Razor 开发 MVC3 应用程序。我想创建一个网页,在其中播放存储在硬盘中的 FLV 文件。

我找到了很多关于如何在 WordPress 中执行此操作的材料,但没有链接解释如何在普通 HTML 中执行此操作。

有人可以帮助我或为我提供资源来完成这项任务吗?

预先感谢

弗朗西斯科

I am developing a MVC3 application with C# and Razor. I want to create a web page where an FLV file, stored in the hard disk, is played.

I found a lot of material on how to do it in WordPress but there is no link that explains how to do it in normal HTML.

May anybody help me or provide me resources in order to perform this task?

Thanks in advance

Francesco

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

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

发布评论

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

评论(1

微凉 2024-11-21 18:54:47

您需要一个播放器才能在 HTML 页面上播放 .flv 文件。如果没有任何可以播放这些文件的 Flash 应用程序,您就无法在 HTML 页面中开箱即用地播放 .flv 文件。

这是播放器,我建议您使用 JW 播放器

这是一个简短的示例嵌入文件

带有玩家 ID 的 div 是您的玩家将被渲染的位置。

jwplayer.js 是 js 文件,允许您播放文件并进行以下 .swf 播放器所需的所有调用

'flashplayer': '/jwplayer/player.swf', 是播放器所在的位置,没有它您将无法播放文件。 注意 URL

'file': '/videos/video.mp4' 是您的本地 .flv 文件与 IIS 服务器相关的位置。 注意网址

<div id='player'>This div will be replaced by the JW Player.</div>

  <script type='text/javascript' src='/jwplayer/jwplayer.js'></script>

  <script type='text/javascript'>
    jwplayer('player').setup({
        'flashplayer':  '/jwplayer/player.swf',
        'width':    '400',
        'height':   '300',
        'file':     '/videos/video.mp4'
    });
  </script>

You need a player to play .flv file on HTML page. You cannot play .flv files out of the box in HTML page without any flash application that can playback those files.

this is player i would advice you to use JW player

this is short example how to embed a file

div with player id is where your player will be rendered.

jwplayer.js is js file that allows you to play files and make all calls needed to .swf player below

'flashplayer': '/jwplayer/player.swf', is where player located without which you will be not able to playback the file. Attention on URL

'file': '/videos/video.mp4' is where your local .flv file is related to IIS server. Attention on URL

<div id='player'>This div will be replaced by the JW Player.</div>

  <script type='text/javascript' src='/jwplayer/jwplayer.js'></script>

  <script type='text/javascript'>
    jwplayer('player').setup({
        'flashplayer':  '/jwplayer/player.swf',
        'width':    '400',
        'height':   '300',
        'file':     '/videos/video.mp4'
    });
  </script>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文