Link to home
Start Free TrialLog in
Avatar of Upperdecker
Upperdecker

asked on

How to show file location in ASP

Does anyone have an ASP code that can dynamically show the current URL of a video playing? I am currently trying to configure my flowplayer with my website and my playlist and would like to embed an object. In order to use the embed option it must have a definite "a href=" but since I use playlists the video comes up dynamically not using "a href=". Is there an ASP code out there that can dynamically create the file location of the video playing.
Avatar of Wayne Barron
Wayne Barron
Flag of United States of America image

you could do something like this

<a href="yoururl.asp/myvideofolder/<%=rs1("FileName")%>">

This will get what you want.
This is something similuar to what I have done on a site.

Good Luck
Carrzkiss
or
If you are wanting to get the URL do something like this

<a href="yoururl.asp?id=<%request.querystring("id")%>">

Or this
<A href="yoururl.asp<%Response.Write Request.ServerVariables("URL")%>">
Avatar of Upperdecker
Upperdecker

ASKER

When i do this i get an error for the rs1, it shows multiple video screens not playing anything with error codes at the top. So far none have worked.
:)

That is a RecordSet.
Are you using ASP/SQL coding?
Or how are you doing your video site?
My playlist menu is XML driven so the video plays when clicked, I viewed the page source from my browser and no where in the code does it have the video playing at that time
Thanks in advance!
The videos are pulled/stored from a cdn. There are urls to them.
Give me a demostration of your URL.
It would help to see something of the site, but no problem, as I know people do not want to give URL's out.

So.
Just paste a demo URL String in here. and let me know exactly what you want, and I will try to provide.
I would give it to you but you would not be able to access it because its located on a work intranet.  Here's the code:
<%@ Language=VBScript %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
 
<c:if test="true">
<!-- include desired tools -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="http://static.flowplayer.org/js/flowplayer-3.0.6.min.js"></script>
</c:if>
<script src="js/flowplayer.embed-3.0.2.min.js"></script>
<script src="js/flowplayer.playlist-3.0.5.min.js"></script>
<!-- player / playlist styling -->
<style>
/* playlist style */
#playlist {
	width:312px;
	height:350px;
	overflow-y:auto;
	overflow-x:hidden;
	border:1px solid #ccc;
	padding:4px 10px 12px 10px;
	background-color:#efefef;
	margin-top:20px;
	float:left;
}
 
/* playlist entry */
#playlist a {
	display:block;
	width:280px;
	height:90px;
	padding:7px;
	background-color:#fff;
	border:1px solid #ccc;
	font:11px "bitstream vera sans", "lucida grande",verdana;
	text-decoration:none;
	margin-top:7px;
	color:#666;
}
 
/* different states of a playlist entry */
#playlist a:hover {
	background-color:#ffc;		
}
 
#playlist a.progress {
	background-color:#efefef;	
}
 
#playlist a.playing {
	border:1px solid #666;
	background-color:#ffc;	
}
 
#playlist a.paused {
	border:1px solid #666;
	background-color:#ffc;	
}
 
/* elements inside playlist entry */
#playlist a img {
	border:0;	
	float:left;
	margin-right:10px;
}
 
#playlist a strong {
	color:blue;		
	padding-bottom:5px;
}
 
#playlist a em {
	border:0;	
	float:left;
	margin-right:10px;
	background:url(img/demos/clock.gif) no-repeat 0 50%;
	padding-left:20px;
	color:#333;
	font-style:normal;
	margin-top:10px;
}
/* look and feel for embed and email tabs */
#shareTabs { 
	list-style:none; 
	padding:0;	
	float:left;
	margin-left:-5px !important;
}
 
#shareTabs li { 	 
	text-indent:-999em;
	padding:0;
	margin:0;
	list-style-image:none;	
}
 
#shareTabs a {
	background: url(img/demos/email_embed_tabs.png) no-repeat;
	display:block;
	width: 48px;  
	height: 44px;
	padding:0px;
	margin:0px;	
}
 
#shareTabs a:hover {
	background-color:#ccc;
}
 
#shareTabs a:focus {
	background-color:#000;
}
	
#shareTabs a.current {
	background-color:#295c72;
}
 
#shareTabs #embedTab {
	background-position: 0 -44px;
}
 
/* container for each pane: video, embed and email */
#panes {
	background:#295c72 url(img/global/gradient/h600.png) repeat-x;
	height:340px;
	width:480px;
	float:left;	
	color:#fff;
	position:relative;
	z-index:1;	
	border:2px solid #fff;
	outline:1px solid #666;	
	font-family:verdana;
	font-size:12px;
	-moz-outline-radius:4px;
}
 
/* embed and email pane */
#emailPane, #embedPane {	
	display:none;	
	margin:10px;		
}
 
/* player container style */
#player {	
	display:block;	
	height:340px;	
	text-align:center;
	color:#fff;
	text-decoration:none;
	cursor:pointer;
	background-color:#000;	
}
 
#panes input, #panes textarea {
	width:430px;
	font-size:12px;
	font-family:verdana;
	border:1px inset #666; 	
	padding:2px;
}
 
#panes textarea {
	padding:4px;
	height:100px;
}
 
#panes button {
	border:1px outset #ccc;	
	cursor:pointer;
	background-color:#f9f9fa;	
}
 
#panes label.left {
	float:left;
	margin-right:15px;	
}
 
#panes label.left input {
	width:180px;		
}
 
#embedPane textarea {
	height:180px;
	background-color:transparent;	
	overflow-x:hidden;
	color:#BBBBBB;
	padding:4px;
}
 
/* close image */
div.close {
	background:url(img/overlay/close.png) no-repeat;
	position:absolute;
	top:5px;
	right:5px;
	width:35px;
	height:35px;
	cursor:pointer;
}
 
</style>
 
<!-- javascript setup. pretty simple stuff -->
<script>
$(function() {
	
	// setup player 
	$f("player", "swf/flowplayer-3.0.7.swf", {
	
		clip: {baseUrl: 'http://myurl.com/Cisco/opt.wmt/000dbc7165ca/Corpcomm/'}
		
	// playlist plugin 
	}).playlist("#playlist");
});
 
</script><script>
$(function() {		
	
	$("#shareTabs a").click(function(e)  {
		$f().hide(true);
		
		// toggle tab class
		var tab = $(this); 
		$("#shareTabs a").removeClass("current");
		tab.addClass("current");
		
		// show / hide panes
		$(tab.attr("href")).show();
		var other = (tab.attr("href") == "#emailPane") ? $("#embedPane") : $("#emailPane");
		other.hide();		
		
		// prevent link's default behaviour
		return e.preventDefault();
	});
	
	// close buttons
	$("div.close").click(function() {
		$("#shareTabs a").removeClass("current");
		$("#emailPane, #embedPane").hide();
		$f().show();
	});
	
	/*
		email form setup. depends on simple JSON responses of the form
			- on error: {message: 'error message'}
			- otherwise it's successs
	*/
	$("#shareForm").submit(function(e) {
			
		var form = $(this);
		form.fadeTo(500, 0.1);
		
		$.getJSON(form.attr("action") + "?" + form.serialize() + "&format=json&jsoncallback=?", function(json) {
			form.fadeTo(500, 1);
			var info = $("#info").show();
			
			if (json.message) {
				info.addClass("alert").html(json.message);			
			} else {
				info.removeClass("alert").addClass("info").html("Email was successfully sent");
			} 
		});	
		
		e.preventDefault();
		return false;		
	});	
	
	
	$f("player", "/swf/flowplayer-3.0.7.swf");
	
	$("#embedPane textarea").html($f().embed().getEmbedCode());
	
});
</script>
 
 
<title>NAME</title>	
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {
	font-size: x-large
}
.style2 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
</style>
<table width="100%" border="0" bgcolor="#CCCCCC" id="top">
  <tr>
    <td><div align="center" class="style1"><img src="img/PLAY_S.png" width="40" height="40" />TITLE</div></td>
  </tr>
</table>
<br />
<div align="center"></div>
<table width="75%" border="0" align="center" cellspacing="1">
  <tr bgcolor="#CCCCCC">
    <td bgcolor="#FFFFFF"><div id="panes">
 
	<!-- video -->
	<a id="player"  href="" class="player plain">
		<img src="img/player/btn/play.png" />	</a>
 
	<!-- email -->	
	<div id="emailPane">
 
		<div class="close"></div>
					<form action="http://flowplayer.org/services/share" method="post" id="shareForm">
			
				<!-- default sender information when user does not supply her own -->
				<input type="hidden" name="fromEmail" value="support@flowplayer.org" />
				<input type="hidden" name="fromName" value="Flowplayer team" />		
				
				<!-- 
					default subject for the message. if not given first 50 characters 
					from the message body is used as the subject
				-->
				<input type="hidden" name="subject" value="Flowplayer video sharing" />
				
				<!-- a link to the video page that is appended to the message body -->
				<input type="hidden" name="url" value="http://flowplayer.org/demos/plugins/sharing-tabbed.htm" />
 
				
				<!-- if user message is not supplied then this default message is used -->
<textarea name="header" style="display:none">
Hello,
 
You should use Flowplayer for all video activities on your website 
</textarea>
	
				<p>
					<label>
						Type in an email addresses <small>(separate multiple addresses with commas)</small>
						<input type="text" class="text" name="to" />
					</label>
				</p>
 
				
				<p>
					<label>
						Personal message <small>(optional)</small>
						<textarea name="message"></textarea>
					</label>
				</p>
	
				<p>
 
					<label class="left">
						Your name <small>(optional)</small> <br />
						<input type="text" class="text" name="userFromName" />
					</label>
					
					<label class="left">
						Your email address <small>(optional)</small>  <br />
 
						<input type="text" class="text" name="userFromEmail" />
					</label>				
				</p>
				
				<br clear="all" />
				
				<p style="margin-top:15px">
					<button type="submit">Send</button>
				</p>
				
				<div class="box" id="info" style="display:none"></div>
				
			</form>	
 
 
	</div>
 
	<!-- embed -->
	<div id="embedPane">
	
		<div class="close"></div>
		
		<h2 class="first style2">Embed this video</h2>
 
		<p>
<label>
				Copy the code below and paste it into your website.
				<textarea onFocus="this.select()"></textarea>
 
			</label>
		</p>		
				
		<p>			
			<button type="button">Close</button>
		</p>
			
	</div>
	
</div>
 
<!-- the tabs -->
<ul id="shareTabs">
	<li><a id="emailTab" href="#emailPane">Email</a></li>
 
	<li><a id="embedTab" href="#embedPane">Embed</a></li>
</ul>
 
 
<br clear="all" />
 
</td>
    <td bgcolor="#FFFFFF"><!--#include file="../../apps/web_editor/admin/upload9/display_data.asp" --></td>
  </tr>
</table>
<br clear="all" />
<div>
  <div align="center"><a href="http://myurl.com/apps/web_editor/admin/upload9/Database_Form.htm" target="_blank">Movie upload</a></div>
</div>

Open in new window

Ok, no problem.
I will have a look at the code once I reboot & eat.
I will be back with you with further questions or a resolution within an hour or so.
If someone does not grab it first.

Carrzkiss
OK.

   I have the page loaded, and what exactly are you wanting to do?
You have a Video playing in the player. And you are wanting to do..... What?
#1: The URL that is in the address bar?
(or)
#2: The URL of the File itself that is playing?
OK.
This will get the current URL
<a href="http://www.yoursite.com<%Response.Write Request.ServerVariables("URL")%>" />http://www.yoursite.com<%Response.Write Request.ServerVariables("URL")%></a>

(Do not put a forward Slash / after the .com , if you do, it will double // it)
Sorry, I been in and out of the office. Unfortunately, I will be away for the next week and will not be able to try your solution.
that is fine.
Take your time, and I will be here when you are ready.

Carrzkiss
I cannot put anything in the href="" of the video player because this will throw my playlist off. Is there anything in the javascript?
ASKER CERTIFIED SOLUTION
Avatar of Wayne Barron
Wayne Barron
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you .
Forgot all about this one.
Glad that I could help.

have a good one.
Carrzkiss

Author Comments:
Thank you .