像面书一样显示视频 [英] show video like face book style
本文介绍了像面书一样显示视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我正在使用以下代码在asp.net应用程序中运行视频文件:
Hello,
I am using this code to run a video file in my asp.net application:
<asp:MediaPlayer ID="MediaPlayer1" runat="server" Height="240px" Width="320px"
MediaSkinSource="~/skins/AudioGray.xaml" MediaSource="~/files/Butterfly.wmv"
Volume="0.9">
</asp:MediaPlayer>
它可以正常工作,但是我需要显示一个小的视频窗口,并且当有人单击此窗口上的播放图标时,则必须在视频开始之前调整屏幕的大小.
就像我们在Facebook上看到的那样....
我该怎么办?
请告诉我.
It works fine, but I need to show a small video-window and when somebody clicks on the play-icon on this window, then the size of screen must be adjusted before the video starts.
Like we can see that in facebook....
How can I do this?
Please tell me.
推荐答案
您可以为此使用银色的灯光控制..
you can use silver light control for this purpose..
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CS.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls"
TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>SilverLight MediaPlayer Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:MediaPlayer ID="MediaPlayer1" runat="server" Height="240px" Width="320px"
MediaSkinSource="~/skins/Professional.xaml" MediaSource="~/files/Butterfly.wmv"
Volume="0.9">
</asp:MediaPlayer>
</div>
</form>
</body>
</html>
C#代码:
c# code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
MediaPlayer1.MediaSource = "~/files/Butterfly.wmv";
}
}
希望对您有帮助..
hope it will help you..
这篇关于像面书一样显示视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文