How to display video as icons in website? - asp.net

Is there a way to display the video in a website page as an arranges icons of videos or thumbnails, so whenever I click on one video it should open a new window to play that video? not play it in the same page.
as this code, but the target="_blank" not leading me to another page?
<a href="video1.aspx" target="_blank">
<object type="video/x-ms-wmv" data="Videos/clock.avi" width="320" height="255" >
<param name="src" value="Videos/clock.avi">
<param name="autoStart" value="0">
alt : clock.avi
</object>
</a>

When you see that with Youtube or other streaming website, is not VideoObject was open a website with video, is just a link to one page with the same video...
You have lot of method for create this "effect" , for optimize, you want just load One image (for create a thumbnails) of your video for create the link
<a href="pageofyourvideo.aspx" target="_blank">
<img src="yourVideoImage.jpg" title="myVideotitle" />
</a>
because, it's unnecessary to load your video, if it's just for link here in other page...
In your video Page, you can juste play your video...
<div id="myVideoBox">
<object type="video/x-ms-wmv" data="Videos/clock.avi" width="320" height="255" >
<param name="src" value="Videos/clock.avi">
<param name="autoStart" value="0">
</object>
</div>
If you've few competences in your language ( aspx, html ? ) you want to create one same page for all your videos, with a parameter in your link in all thumbnails...
For sample, you can create two thumbnails with the same link, and just parameter change :
sample with php link :
<!-- first Thumbnails link to video1.avi -->
<a href="pageofyourvideo.php?myvideo=video1.avi" target="_blank">
<img src="yourVideoImage.jpg" title="myVideotitle" />
</a>
<!-- second thumbnails link to video2.avi -->
<a href="pageofyourvideo.php?myvideo=video2.avi" target="_blank">
<img src="yourVideoImage2.jpg" title="myVideotitle2" />
</a>
and you received parameters in your video page : (always with php...)
<!-- If parameter "myvideo" was "video2.avi" video2.avi was played... -->
<div id="myVideoBox">
<object type="video/x-ms-wmv" data="Videos/clock.avi" width="320" height="255" >
<param name="src" value="<?php echo $_GET["myvideo"]; ?>">
<param name="autoStart" value="0">
</object>
</div>
I use .php for sample because I'm not familiar with .aspx but you can make this sample in .aspx :-)

Related

Targeting a frame in frameset

I am working with framesets for an internet browser-based application that will be running on a local machine. I would like when an image is clicked to target another frame where details will appear. I tried to include "target=details" at the end of the image source as follows but that produced a sytax error:
IMAGE code in gallery.php:
<a href=details.php?c_id=<?php echo $c_id ?> ><img src="./images/<?php echo $row['cfilename'] target=details;?>" width="100" height="100" alt="" />
FRAMESET in index.php:
<FRAMESET ROWS="17%,*">
<FRAME SRC="titlebar.php" NAME=TITLE SCROLLING=NO>
<FRAMESET COLS="26%,30%,*">
<FRAME SRC="sidebar.php" NAME=sidebar TARGET=gallery>
<FRAME SRC="gallery.php" NAME=gallery>
<FRAME SRC="details.php" NAME=details>
</FRAMESET>
<NOFRAMES>
<H1>Criminal Records Database</H1>
No frames? No Problem! Take a look at our
no-frames version.
</NOFRAMES>
</FRAMESET>
you need to add target="_nameofframe" to the href tag and tell it where to open the new link.
in your case, the href of the gallery images should have the following target="details"
i.e.
<a href=details.php?c_id=<?php echo $c_id ?> ><img src="./images/<?php echo $row['cfilename'];?>" target="details" width="100" height="100" alt="" />

Link not working in asp.net master page for some reason

I am working on asp.net website using webforms & i am facing strange problems for some unknown reason.
I am different banner in different areas of teh page & one common banner in the header section of the MasterPage, Banner show up as it should but problem is that link with the banner is not working.
Below is the partial code generated after page display.
<div class="horizontalBannerBar">
<!-- Header Banner -->
<div class="pnlHeaderBanner" id="pnlHeaderBanner">
<a target="_blank" href="http://abc.com" class="bannerlink" id="hypLnkHeaderBanner"><img style="border-width:0px;" src="../images/Banners/32dfe9ee-0832-4d89-8c61-45b0ef371f1f.jpg" id="imgHeaderBanner"></a>
</div>
<!-- Header Banner -->
</div>
I am using Panel as a wrapper so that i can hide the banner in case banner is not present .
Below us the Code i use to assign value to hyperlink control & image control
DataSet ds = DataProvider.GetTopBanner(ArticleID, PageID, IssueID, CategoryID, BannerLayoutPosition, LangID);
if (ds.Tables[0].Rows.Count > 0)
{
imgHeaderBanner.ImageUrl = ds.Tables[0].Rows[0]["ImagePath"].ToString();
hypLnkHeaderBanner.NavigateUrl = ds.Tables[0].Rows[0]["BannerURL"].ToString();
}
else
{
imgHeaderBanner.Visible = false;
pnlHeaderBanner.Visible = false;
}
Actual .ASPX page code
<div class="horizontalBannerBar">
<!-- Header Banner -->
<asp:Panel ID="pnlHeaderBanner" CssClass="pnlHeaderBanner" runat="server">
<asp:HyperLink ID="hypLnkHeaderBanner" CssClass="bannerlink" runat="server" Target="_blank">
<asp:Image ID="imgHeaderBanner" runat="server" BorderWidth="0" />
</asp:HyperLink>
</asp:Panel>
<!-- Header Banner -->
</div>
It seems HTML is breaking up somewhere but i am not able to see it even on fiddle it doent work in FF & Chrome while link works in IE 9..
Example LINK
It's because of the z-index: -999; in your CSS. If you set it to 0 then your link will work.
Also the <img /> tag is not properly closed in the HTML sample you posted at the top. I doubt that's the actual HTML generated by ASP.NET though.
<div class="horizontalBannerBar">
<!-- Header Banner -->
<div class="pnlHeaderBanner" id="pnlHeaderBanner">
<a target="_blank" href="http://abc.com" class="bannerlink" id="hypLnkHeaderBanner">
<img style="border-width:0px;" src="../images/Banners/32dfe9ee-0832-4d89-8c61-45b0ef371f1f.jpg" id="imgHeaderBanner" />
</a>
</div>
<!-- Header Banner -->
</div>

transit to next page from casGenericSuccess page using link in jasing cas single sign on

I want to navigate to my added jsp page from casGenericSuccess.jsp but I am not able to transit to next page using hyperlink.
What i did is:
changes in login-webflow.xml
<view-state id="viewGenericLoginSuccess" view="casLoginGenericSuccessView">
<transition on="userManagement" to="userManagementHome" />
</view-state>
default_views.properties
userManagementHome.(class)=org.springframework.web.servlet.view.JstlView
userManagementHome.url=/WEB-INF/view/jsp/default/ui/userManagementHome.jsp
casGenericSuccessView.jsp
<jsp:directive.include file="includes/top.jsp" />
<div id="msg" class="success">
<spring:message code="screen.success.header" />
<p><spring:message code="screen.success.success" /></p>
<p><spring:message code="screen.success.security" /></p>
<a href="login?_flowExecutionKey=${flowExecutionKey}&_eventId=userManagement">User Management
</div>
<jsp:directive.include file="includes/bottom.jsp" />
Also I tried changing href to login?&_eventId=userManagement
I have my userManagementHome.jsp at same place where casGenericSuccess.jsp is present.
can someone please help me out navigate to my page.
Right now it is not navigating and displays the same casGenericSuccess.jsp page on click of user management link.
Try with execution instead of _flowExecutionKey

Using Object tags in asp.net

I have this html code for embedding a video in an aspx page:
<OBJECT ID="MediaPlayer" WIDTH="192" HEIGHT="190" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="videofilename.wmv">
<PARAM name="autostart" VALUE="false">
<PARAM name="ShowControls" VALUE="true">
<param name="ShowStatusBar" value="false">
<PARAM name="ShowDisplay" VALUE="false">
<EMBED TYPE="application/x-mplayer2" SRC="videofilename.wmv" NAME="MediaPlayer"
WIDTH="192" HEIGHT="190" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0"> </EMBED>
</OBJECT>
The thing is, I want to set its parameters from my C# code-behind (f.e., the path to the file to be played).
I know I should add runat="server" but that's not the only thing. The code-behind doesn't recognize any element of the type MediaPlayer no matter what. (I'm trying to access it from my Page_Load(..))
How should I do this?
10x
Create a HtmlGenericControl. You can set the attributes through the Attributes property via your codebehind. And add the sub-elements through Controls.
HtmlGenericControl obj = new HtmlGenericControl("object");
HtmlGenericControl embedTag = new HtmlGenericControl("embed");
embedTag.Attributes["type"] = "application/x-mplayer2";
obj.Controls.Add(embedTag);
flashPlaceHolder.Controls.Add(obj);
There is no ASP.NET control for the OBJECT tag, so you have to generate its HTML yourself. There are two simple ways to do this. The first way is to use <% %> tags in your ASPX file, like this:
<OBJECT ID="MediaPlayer" WIDTH="192" HEIGHT="190" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="<% =FileName %>">
...
</OBJECT>
The other way is to create a LiteralControl in your codebehind, and set its HTML to whatever you want:
LiteralControl myObject = new LiteralControl();
myObject.Text =
#"<OBJECT ID='MediaPlayer' WIDTH='192' HEIGHT='190' CLASSID='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' STANDBY='Loading Windows Media Player components...' TYPE='application/x-oleobject'>
<PARAM NAME='FileName' VALUE='" + FileName + "'>
...
</OBJECT>';";
Page.Controls.Add(myObject);

how to play and stop sound control by javascript in wmplayer?

how to play and stop sound control by javascript in wmplayer in asp.net ?
You can embed the windows media player in an HTML page and then use javascript to manipulate the object.
They have properties for volume, balance and methods to mute.
http://msdn.microsoft.com/en-us/library/dd564581(VS.85).aspx
EDIT:
Here's another good reference: http://www.mioplanet.com/rsc/embed_mediaplayer.htm
<script type="text/javascript">
function doThings(n) {
if(n==1)
document.getElementById('VIDEO').controls.play();
else
if(n==2)
document.getElementById('VIDEO').controls.stop();
}
</script>
<OBJECT id="VIDEO" width="320" height="240"
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject">
<PARAM NAME="URL" VALUE="town.mid">
<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
<PARAM NAME="AutoStart" VALUE="False">
<PARAM name="uiMode" value="none">
<PARAM name="PlayCount" value="9999">
</OBJECT>
<input type="button" value="start" onclick="doThings(1)"/>
<input type="button" value="stop" onclick="doThings(2)"/>

Resources