user347640
user347640

Reputation: 223

inserting and retrieving audio and video from database

I did a small web application in which i have made use of windows media player dll. To play the audio and video file and i have uploaded audio and video by creating a folder in the application.

And the media player which i have used is only possible to play audio and video if we give the path directly like

MediaPlayer1.FileName="C:\Waka.wav";

so please help me how to insert and retrieve audio and video in database and in a player.

Upvotes: 2

Views: 2855

Answers (2)

ajay_whiz
ajay_whiz

Reputation: 17931

Instead of using media player dll use <embed/> tag browser will choose the media player for the user and this will be platform independent.

Why do you want to make use of database for saving files as @David say's you can store it on server file system. In your <embed/> tag you can specify the path on the server.

Upvotes: 0

David
David

Reputation: 218877

Is the media player playing the file on the server or on the client? You say it's a web application, so I'm currently assuming the latter. If your claim that the media player can only use local paths is true, then you'll have to have the client download the file to a local path and pass that to the media player. It won't make for a particularly fluid user experience. Does the media player really not accept URLs as paths? If this is the case then it sounds like you might be using a media player that doesn't suit your needs. Consider using a different one.

Also, why is the file being served from a database? File systems and web servers are really good at serving files, I'd recommend using those instead. A relational database is good for relational data that can be indexed, sorted, pivoted, etc. It's usable for binary files, but it's not really suited for them.

Upvotes: 2

Related Questions