【问题标题】:Showing Windows media control asp.net c#.显示 Windows 媒体控件 asp.net c#。
【发布时间】:2014-05-25 02:19:16
【问题描述】:

场景:我正在创建一个用户上传视频的网络应用程序,其路径存储在数据库中。 我正在显示包含视频的数据列表,并且在该数据列表的 item_command() 事件上,我正在导航到一个新表单 (Webform2),我正在使用 Windows 媒体播放器控件播放该视频。

问题是:窗体中没有显示 windows 媒体播放器控件。

这是我将控件添加到页面的地方。

<div style="text-align: center; vertical-align: middle">
        <cc1:Media_Player_Control ID="Media_Player_Control1" runat="server" Height="299px" Width="542px" />
             <br />

</div>

这里我将 URL 分配给控件

    protected void Page_Load(object sender, EventArgs e)
    {
        long vidid=Convert.ToInt64(Session["vid"]); //Getting id of the item that is clicked
        DataClasses1DataContext db = new DataClasses1DataContext();
        var vid = (from v in db.Videos
                   where v.videoId == vidid
                   select v.videoPath).FirstOrDefault();





        Media_Player_Control1.MovieURL = vid.ToString();


    }

【问题讨论】:

    标签: c# asp.net


    【解决方案1】:

    在您的标记中使用它example link

    <OBJECT ID="Player" height="0" width="0"
    CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
    </OBJECT>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-11-06
      • 1970-01-01
      • 1970-01-01
      • 2021-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多