Retrieve videos from databse
Hi,
I want to store video name in database and videos in one folder.This can be achieved by fileupload.
How to retrieve videos from database and display on windows media player depending upon the query?
nandhinijp
Junior Poster in Training
84 posts since Dec 2007
Reputation Points: 13
Solved Threads: 4
- Retrive name and video location from database
- Prefix video file location string with rest of the path
- Pass this new generated string path to media player
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
Please explain how to pass these details to media player.
nandhinijp
Junior Poster in Training
84 posts since Dec 2007
Reputation Points: 13
Solved Threads: 4
Here is nice tutorial how to do it in ASP.NET with C# or this one in regards of Silverlight
However with Silverlight you getting in trouble as not everyone has it, I'm one of them as I believe that is useless, just attempt to bit Adobe and the Flash (but that is just me)
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
Firstly upload the video file to a folder in the server by :
if (flUpload.PostedFile.ContentLength > 0)
{
String strPath = Server.MapPath("../") + "UploadedFiles/Folder";
flUpload.PostedFile.SaveAs(strPath + "/" + this.flUploadBrief.FileName.ToString());
}
where <asp:FileUpload runat="server" ID="flUploadBrief" /> is the FileUpload Control.
And save the name of the File in database.
Then u can view the video by : <embed src="video.avi" />
sebastian3
Junior Poster in Training
55 posts since May 2008
Reputation Points: 10
Solved Threads: 1
Hi,
If i give src="video.avi" its load only that video.But I want to play video from database.. Video name in DB video in folder.How to give src="..." This is my problem now.Upload k.
nandhinijp
Junior Poster in Training
84 posts since Dec 2007
Reputation Points: 13
Solved Threads: 4
This is the Object tag.
<OBJECT id=mPlayer height=250 width=320 classid=CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95 VIEWASTEXT>
<PARAM NAME="filename" VALUE="moviepreview/<%Response.Write(Request.QueryString.Get("id"));%>">
You have to fill the value from server side code.
sebastian3
Junior Poster in Training
55 posts since May 2008
Reputation Points: 10
Solved Threads: 1
<param name='fileName' value="../videos/<%#(Request.QueryString["VID"])%>">
I tried this but its working only one paritcular link only once.Its not working for all queries.
.I have 2 pages X and Y. I click the gridview hyperlink in X page it goes to Y page.In X page datanavigateurl field are specified.query string is empty for all other link.thats the problem.
nandhinijp
Junior Poster in Training
84 posts since Dec 2007
Reputation Points: 13
Solved Threads: 4
I solved that problem.I did some mistake in querystring.
nandhinijp
Junior Poster in Training
84 posts since Dec 2007
Reputation Points: 13
Solved Threads: 4
I have one more problem regarding this.
I have 2 pages X and Y. I click the gridview hyperlink in X page it goes to Y page.In X page datanavigateurl field are specified.I want to pass only id of the video.In that Y page i want to do some server side code in source code(html) .coz there is some conditions to retrieve videoname.So i want to process and result will be assign to one variable that variable will be assign to media player.Help me!
nandhinijp
Junior Poster in Training
84 posts since Dec 2007
Reputation Points: 13
Solved Threads: 4
i have some problem in media player.because all videos are working perfectly in my system.But in other system one of my mpeg video didnt play in that player.I am using above codings.i am checking more than 5 systems.but didnt play .whats problem here?Help me.How to solve that problem?Any version problem?
nandhinijp
Junior Poster in Training
84 posts since Dec 2007
Reputation Points: 13
Solved Threads: 4
Actually the video can be played in the player you select in your object tag code.It can be Media Player,Real Player,Google Video Player depending on the player available to your client machine. Here i suspect the other machines doesn't have the required Active X. No problem, with your Object please add a Embed Tag with same parameters. The embedded player will play in all machines.
The format is as below. Please change the parameters as per ur requirements.
<object width="320" height="290"
classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
id="mediaplayer1"><param name="Filename" value="kids.mpg"><param name="AutoStart" value="True"><param name="ShowControls" value="True"><param name="ShowStatusBar" value="False"><param name="ShowDisplay" value="False"><param name="AutoRewind" value="True"><embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/"
width="320" height="290" src="/support/dreamweaver/ts/documents/kids.mpg"
filename="kids.mpg" autostart="True"
showcontrols="True" showstatusbar="False"
showdisplay="False" autorewind="True"></embed></object>
Please let me know if it works.
sebastian3
Junior Poster in Training
55 posts since May 2008
Reputation Points: 10
Solved Threads: 1
In embed tag you specify src and file name.Both are same or not.
I used ur solution.It also doesnt play video.But controls are working that means play mode changed to stop mode.Video doesnt display.Please solve this!
nandhinijp
Junior Poster in Training
84 posts since Dec 2007
Reputation Points: 13
Solved Threads: 4
Put the absolute filepath in the src and param tags and filename in the filename tag. I think u r having path problems. Just do some R&D. Put the video in the current folder and change all the 3 values same :]
<param name="Filename" value="kids.mpg">
src="kids.mpg"
filename="kids.mpg"
If it works then carry on with ur proceedings.
Do let me know if it works.
sebastian3
Junior Poster in Training
55 posts since May 2008
Reputation Points: 10
Solved Threads: 1
I am using some sample mpeg fies which is download from net.One of the video is perfectly working in all client machine.someone is not working.whats the reason for this.I am using .net 2005.There some of the embed tags attributs are not valid
autostart="True" showcontrols="True" showstatusbar="False" showdisplay="False" autorewind="True".just it gives error msg.it doesn affect anything.
nandhinijp
Junior Poster in Training
84 posts since Dec 2007
Reputation Points: 13
Solved Threads: 4
Just i am playing mpg file in media player without using program.it gives this error msg
"Windows Media Player cannot play the file. The Player might not support the file type or a required codec might not be installed on your computer."
now i am using the original video which one i want to use in website.If this file is working in media player its also working in pgm.How to solve this problem?
nandhinijp
Junior Poster in Training
84 posts since Dec 2007
Reputation Points: 13
Solved Threads: 4
Oh then it is the problem of the media file, no issues. No problem for the program. Collect some original media files and test on them. And if the no codec error comes , then the user should install required files from site, that is ok , no problems with that , it gives in all video websites that one should install the required pluggins.
I think u have done ur part.
sebastian3
Junior Poster in Training
55 posts since May 2008
Reputation Points: 10
Solved Threads: 1
How can i give that msg?and also How to provide the details for download in site.little bit confused here.I saw that msg in lot of sites.
I am using video cam to take videos after that i am using that video in site.please explain?
nandhinijp
Junior Poster in Training
84 posts since Dec 2007
Reputation Points: 13
Solved Threads: 4
No no you don't have to do anything for that, if the system doesn't find the required activex controls it will automatically direct to the activex provider site . U just look whethear the video plays in those systems where the activex are there.
I would like to know if the mpeg,avi files are now running in ur webpage:S
sebastian3
Junior Poster in Training
55 posts since May 2008
Reputation Points: 10
Solved Threads: 1
Just i upload only one sample page with tag details in site.site is perfectly ok in my sys.In other machine i tried that site.It gives blank media player.it doesnt give any msg like u said.what to do?
But wmv avi files are working perfectly in all client machine.mpeg files only problem.Videocam output format mpeg.Any conversion need here?
nandhinijp
Junior Poster in Training
84 posts since Dec 2007
Reputation Points: 13
Solved Threads: 4