help on video database

F

Fipp

I am trying to create a database and looking for suggestions. I have many
short video clips and want to create a database that contains information
about each clip.
I am thinking that I can include a field that refrences the location of the
video on my computer since I hear that there is no reason to insert the
actual clip into the database.
I would then like to insert a media player into a form and be able to play a
query or list of clips.

Is this the right idea?
If so I am good with the design of the database. I understand how to build
the form. I really don't understand how to reference the video clip? I also
am wondering if there is a way to automate that process and import a set of
20 video clips at a time as opposed to creating a record at a time and having
to go through and reference each one of them?

Any opinions or ideas would be great.
Thanks
 
M

Maverick

As to playing videos from the database, there are several threads here that
already deal with that. You can do a search on Windows Media Player and
video. You should find what you need. You do have the right idea however.
Placing the media player on a form and calling that form with a reference to
the path (using a button to call the reference) works well.

I'm not able to help you with the second question. You could certainly get
some help on creating code to go to a folder and obtain the filenames and
paths of the videos in that folder. However, your database is likely to have
other pieces of data that you can't really automate that way (e.g. Title,
Actors, Year Released, etc.).
 
D

Dirk Goldgar

Fipp said:
I am trying to create a database and looking for suggestions. I have many
short video clips and want to create a database that contains information
about each clip.
I am thinking that I can include a field that refrences the location of
the
video on my computer since I hear that there is no reason to insert the
actual clip into the database.

Good plan.
I would then like to insert a media player into a form and be able to play
a
query or list of clips.

Is this the right idea?

Sounds reasonable to me.
If so I am good with the design of the database. I understand how to build
the form. I really don't understand how to reference the video clip?

You can play the video clip in a separate window just by following the path
to it as a hyperlink, so long as its file-extension is registered with an
suitable application (such as Windows Media Player). That's simple enough;
the code is just (for example):

'----- start of sample code #1 -----
Private Sub cmdPlayFile_Click()

Application.FollowHyperlink Me!txtVideoPath

End Sub
'----- end of sample code #1 -----

If you want to play the file in a window on your form itself, you can add a
Windows Media Player control to your form. You should find it in the list
of additional controls displayed when you click the "More Controls" button
in the form design toolbox, or click menu items Insert -> ActiveX Control...

With the Media Player Control on the the form, you can start it playing a
video file by setting its URL property to the path to the file. Here's an
example:

'----- start of sample code #2 -----
Private Sub cmdPlayFile_Click()

Me.WindowsMediaPlayer0.URL = Me!txtVideoPath

End Sub
'----- end of sample code #2 -----

So long as the video (or audio, or image) file is one whose extension WMP
can handle, this should work.
I also
am wondering if there is a way to automate that process and import a set
of
20 video clips at a time as opposed to creating a record at a time and
having
to go through and reference each one of them?

For that, you'd have to write code to open a Windows File Open dialog set to
allow multiselect of files, then parse and process the result of the
selection, saving each selected file as a new record in your database. The
basic code to open the dialog is here:

http://www.mvps.org/access/api/api0001.htm

but there some flags you have to set and tricks you have to know to
effectively use the multiselect feature. That should probably be the
subject of a separate question.
 
F

Fipp

Dirk,
Thank you very much!

Now here is where I am at.

I have a form and on the form I have WMP inserted.
I have records and one of the fields in the record is a hyperlink field
pointing to a video clip.
I can click on the hyperlink and it will open a new window and load my video
clip and play it. That all works just fine.
I am now trying to get the WMP in my form to load the current 'HYPERLINK'
based on the record that is open when I click the 'play' button.

I have the following code.

Private Sub play_Click()

Me.WMP.URL = Me!HYPERLINK

End Sub

I receive a pop up box that says "the file you are trying to play has an
extension (.avi#) that does not match the file format. Do you want the player
to try and play this format? I click yes and nothing works.

Any suggestions would be appreciated
 
D

Dirk Goldgar

(re-posting, as my original reply hasn't appeared)

Fipp said:
Dirk,
Thank you very much!

Now here is where I am at.

I have a form and on the form I have WMP inserted.
I have records and one of the fields in the record is a hyperlink field
pointing to a video clip.
I can click on the hyperlink and it will open a new window and load my
video
clip and play it. That all works just fine.
I am now trying to get the WMP in my form to load the current 'HYPERLINK'
based on the record that is open when I click the 'play' button.

I have the following code.

Private Sub play_Click()

Me.WMP.URL = Me!HYPERLINK

End Sub

I receive a pop up box that says "the file you are trying to play has an
extension (.avi#) that does not match the file format. Do you want the
player
to try and play this format? I click yes and nothing works.

Any suggestions would be appreciated


You shouldn't have used a hyperlink field to store the path. Hyperlink
fields are stored in a special format that lets Access treat it specially,
but that causes difficulties for most other purposes. When I wrote that you
could follow the path as a hyperlink using Application.FollowHyperlink, I
didn't mean that you should store it as one.

Change the field from Hyperlink type to Text type, and then correct the
records you've already entered by removing the leading and trailing "#'
characters. When you've done that, and you see that the field contains only
the path to the file, then your line
Me.WMP.URL = Me!HYPERLINK

will work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top