嗨,我想在我的页面中动态播放一部电影,但我的播放器需要一个 URL,并且它只从 Html 部分填充。如何将 URL 表单页面加载传递给 Html 部分。这是我的代码:谢谢
页面加载代码:
protected void Page_Load(object sender, EventArgs e)
{
// string n = String.Format("{0}", Request.Form['customerName']);
string connStr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
SqlConnection sqlconn = new SqlConnection(connStr);
SqlCommand sqlcmd = new SqlCommand();
sqlcmd = new SqlCommand("SELECT Pic FROM AllMemberOfSite where UserName=@UserName", sqlconn);
sqlcmd.Parameters.AddWithValue("@UserName", (string)Session["User"]);
sqlconn.Open();
Image4.ImageUrl = ((string)sqlcmd.ExecuteScalar()).ToString();
sqlcmd = new SqlCommand("SELECT Video FROM AddVideo where ID=@ID", sqlconn);
sqlcmd.Parameters.AddWithValue("@ID", Request.QueryString["ID"]);
string URL = ((string)sqlcmd.ExecuteScalar()).ToString();
Page.DataBind();
sqlcmd = new SqlCommand("SELECT Title FROM AddVideo where ID=@ID", sqlconn);
sqlcmd.Parameters.AddWithValue("@ID", Request.QueryString["ID"]);
Label6.Text = ((string)sqlcmd.ExecuteScalar()).ToString();
sqlconn.Close();
}
这是html鳕鱼:
<?
$mobile=mobile_device_detect();
if($mobile)
{
?>
<div class="video-js-box" >
<video id="example_video_1" class="video-js" width="590" height="442" controls="controls" preload="auto" align="center">
<source src="videos/Ostad Pirmoradi2.flv" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
</video>
</div>
<?
}else
{?>
<div name="flashcontent2" id="flashcontent2"></div>
<script type="text/javascript" language="javascript">
if (!FlashDetect.installed) {
document.getElementById("flashcontent2").innerHTML = "<b>This content requires the Adobe Flash Player. If the player does not load here in a moment please install flash. <a href=http://www.adobe.com/go/getflash/>GET FLASH HERE</a></b>";
} else {
// Flash embed code starts
//delete the below sample
var so1 = new SWFObject("YTPlayer.swf", "YTPlayer", "640" "320", "8", null, true);
so1.addParam("allowFullScreen", "true");
so1.addParam("allowSciptAccess", "always");
so1.addVariable("movieName", "videos/Ostad Pirmoradi2.flv");
so1.addVariable("autoStart", "true");
//so1.addVariable("logoPath", "logo/30alogo.png"); // 60*60 dimension
// so1.addVariable("logoPosition", "top_left"); // accepted values are top_left, top_right, bottom_left and bottom_right
// so1.addVariable("logoClickURL", "http://www.flvhosting.com
/af/idevaffiliate.php?id=385");
// so1.write("flashcontent2");
// Flash Embed code ends
}
</script>
<?}?>