I'm building a section of a website to show streaming videos. There's a lot more logic involved, but the jist of it all is the video id is pulled as a session variable, but before the video is played, a random ad is played beforehand (based on the topic of the video).
I use 3 pages for this.
The main .aspx page has the following:
Code:
<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" id="VIDEO" type="video/x-ms-asf"
width="400" height="365" standby="Loading Microsoft Windows Media Player components..."
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715">
<param name="StretchToFit" value="1" />
<param name="AutoStart" value="true" />
<param name="Balance" value="0" />
<param name="EnableContextMenu" value="1" />
<param name="Enabled" value="1" />
<param name="EnableErrorDialogs" value="1" />
<param name="WindowlessVideo" value="0" />
<param name="Rate" value="1.000" />
<param name="CurrentPosition" value="0.000" />
<param name="CurrentMarker" value="1" />
<param name="FullScreen" value="0" />
<param name="Mute" value="0" />
<param name="PlayCount" value="1" />
<param name="Uimode" value="Full" />
<param name="Volume" value="50" />
<param name="URL" value ="<%Response.Write(strPlay) %> "/>
<embed id="mpFAB" type="video/x-ms-asf" src="<%Response.Write(strPlay) %>" width="400" height="345"
showcontrols="1" />
</object>
The code behind (.aspx.vb) sets the variable for the URL after several queries as such:
Code:
strPlay = "/MediaList.aspx?u=" & (strUnderwriter) & "&ut=" & (strUTitle) & "&v=" & (strURL) & "&vt=" & (strVTitle)
Finally, the playlist (MediaList.aspx) contains the following code:
Code:
<%@ Page Language="VB" %>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim strUnderwriter As String
strUnderwriter = Request.QueryString("u")
Dim strURL As String
strURL = Request.QueryString("v")
Dim strUTitle As String
strUTitle = Request.QueryString("ut")
Dim strVTitle As String
strVTitle = Request.QueryString("vt")
Response.ContentType = "video/x-ms-asf"
Response.Expires = 0
Response.Write("<ASX version=""3.0"">")
Response.Write("<ENTRY CLIENTSKIP=""NO"">")
Response.Write("<TITLE>" & (strUTitle) & "</TITLE>")
Response.Write("<COPYRIGHT> 2008 </COPYRIGHT>")
Response.Write("<ref href = """ & (strUnderwriter) & """ />")
Response.Write("</ENTRY>")
Response.Write("<ENTRY>")
Response.Write("<TITLE>" & (strVTitle) & "</TITLE>")
Response.Write("<ref href =""" & (strURL) & """ />")
Response.Write("<COPYRIGHT> 2008 </COPYRIGHT>")
Response.Write("</ENTRY>")
Response.Write("</ASX>")
End Sub
</script>
Bookmarks