如何播放viedo文件 [英] how to play viedo file

查看:68
本文介绍了如何播放viedo文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我已经将视频文件上传到我的项目中.现在我要播放它.如何执行..plz可以给它一个想法.

在此先感谢

Hi all

I already uploaded video files to my project .now i want to play it.how to do it ..plz give idea about it.

Thanks in advance

推荐答案

将数据列表绑定到视频网址
Bind datalist to the Video url
string selectSQL = "SELECT Video_Name,url FROM media";
           SqlConnection cnn = new SqlConnection(connectionString);
           SqlDataAdapter adp = new SqlDataAdapter(selectSQL, cnn);
           DataSet ds = new DataSet();
           adp.Fill(ds);
           DataList1.DataSource = ds;
           DataList1.DataBind();


使用数据列表项命令


use datalist item command

protected void DataList1_ItemCommand1(object source, DataListCommandEventArgs e)
   {
        if (e.CommandName == "select")
           { embed1.Attributes.Add("src", @"http://~/Uploads4/");
               embed1.Attributes.Add("filename",                        Server.MapPath(e.CommandArgument.ToString()));

           }
       }


使用embed标签构建媒体播放器


use the embed tag to built media player

<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="Player1">

        <param name="URL" value="http://localhost/Music.wmv">

        <param name="http://path_to_the_video">

        <param name="AutoStart" value="1">

        <param name="ShowControls" value="1">

        <param name="ShowStatusBar" value="1">

        <param name="ShowDisplay" value="1">

        <param name="stretchToFit" value="1">

        <embed runat="Server" id="embed1" type="application/x-mplayer2"



pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" 



width="424" height="379" 



 autostart="1" showcontrols="1" showstatusbar="1">

</embed>

</object>


</param></param></param></param></param></param></param>



这是我使用过的代码.
希望它也对您有帮助



it is the code that i have used.
hope it helps you also


您好,

在Web应用程序上播放视频的方法有很多.
这取决于您使用的视频格式.我优先使用.swf
文件来播放视频.B''coz这些扩展易于传输.

这里" m提供了一些链接,可以在网站上推荐播放视频

http://www.codeproject.com/KB/aspnet/playSwf.aspx



http://www.aspnetflashvideo.com/

而且,如果您使用Ajax Flash控件,则它比其他控件要好.即使您使用的版本也较低,


最好的
Hi,

There are so many ways to play videos on your web application.
that is based on which format you are using for your videos.I prepered use .swf
files to play videos.B''coz these extenssions are easy to transfer.

Here ''m providing some links to reffer playing video on website

http://www.codeproject.com/KB/aspnet/playSwf.aspx

and

http://www.aspnetflashvideo.com/

And If you use Ajax flash controls it is better than others.Eventhough you are using lower versions also.


All the Best




您可以使用此插件-
http://jquery.malsup.com/media/video.html [
Hi,

You can use this plugin-
http://jquery.malsup.com/media/video.html[^]


这篇关于如何播放viedo文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆