Click here to Skip to main content
15,915,093 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I wanna play a video without storing it in solution. Im just saving that link directly in my DB. Is it possible to play a video with out storing in solution or any where.


Like this


mediaelement.source="www.xxxx/videos/aa.com";

Any suggestions plz..

EDIT (Copy-pasted from OP's comment)

I tried with uri like this..
playVideos.Source = new Uri("http://channel9.msdn.com/coding4fun/articles/MissionControl-A-Flexible-API-for-Remote-Device-Control", UriKind.Relative);
Im getting following error.
A relative URI cannot be created because the 'uriString' parameter represents an absolute URI.

When i chnage like this
playVideos.Source = new Uri("MissionControl_mid.mp4", UriKind.Relative);
It works
here the video (MissionControl_mid.mp4) is saved in my project in clienbin.

So my problem is instead of giving the video which is my project. I wanna give direct url there...
Posted
Updated 2-Sep-14 20:55pm
v4
Comments
Sergey Alexandrovich Kryukov 3-Sep-14 1:36am    
What does it mean, "storing in a solution"? Of course you can play a video resource from URI (how can it be *com? :-), but you did not tell us where to play it. And what's the problem?
—SA
Usha Sanjee 3-Sep-14 1:47am    
I tried with uri like this..
playVideos.Source = new Uri("http://channel9.msdn.com/coding4fun/articles/MissionControl-A-Flexible-API-for-Remote-Device-Control", UriKind.Relative);
Im getting following error.
A relative URI cannot be created because the 'uriString' parameter represents an absolute URI.

When i chnage like this
playVideos.Source = new Uri("MissionControl_mid.mp4", UriKind.Relative);
It works
here the video (MissionControl_mid.mp4) is saved in my project in clienbin.

So my problem is instead of giving the video which is my project. I wanna give direct url there...
Usha Sanjee 3-Sep-14 2:00am    
Any suggestions plz...
Sergey Alexandrovich Kryukov 3-Sep-14 3:18am    
You still did not answer: play where? You should tell use your application type, the component you use for playing media, etc.
—SA
Usha Sanjee 3-Sep-14 4:31am    
It is a silverlight application. As we know there will be a web also. so here I'm taking a aspx page and using a Media player control to play the video.

When user clicks on a hyperlink in silverlight.I'm navigating to this web page and need to display the video, In that same page.

This is how I'm working...

UriKind.Relative tells the Uri class to construct the Uri from your current pages' address and the string passed in - in other words: the string passed in should be interpreted as relative to current location!
The error tells you that you can not create a relative Uri from a absolute Uri! http://channel9.msdn.com IS an absolute Uri.
What you have to do is change the Uri creation option to UriKind.Absolute or omit it totally...
 
Share this answer
 
Comments
Usha Sanjee 3-Sep-14 7:54am    
I also tried with Absolute, but not able to load any video

Uri uri1 = new Uri("http://techslides.com/demos/sample-videos/small.webm", UriKind.Absolute);
playVideos.Source =uri1;
Kornfeld Eliyahu Peter 3-Sep-14 7:55am    
'not able to load any video' - please elaborate!
Usha Sanjee 3-Sep-14 7:59am    
yes In browser its showing empty page
I tried with HTML5 tags for a Youtube video,and also for any type of videos in online

<embed width="420" height="315" id="playing" runat="server"/>

In code behind
string url = Convert.ToString("Youtube url");
Response.Redirect(url);</pre>


Its worked....:)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900