0

I'm using the sample app from microsoft here:

http://msdn.microsoft.com/en-us/library/hh394041(v=vs.92).aspx

as a starting point to develop an app that allows the user to record multiple videos in the app to a collection.

What is the best way to accomplish this? I noticed that the example uses a fileSink object to specify the capture source and file name in isolated storage.

 Private Sub StartVideoRecording()
    Try
        ' Connect fileSink to captureSource.
        If captureSource.VideoCaptureDevice IsNot Nothing AndAlso captureSource.State = CaptureState.Started Then
            captureSource.Stop()

            ' Connect the input and output of fileSink.
            fileSink.CaptureSource = captureSource
            fileSink.IsolatedStorageFileName = isoVideoFileName
        End If

        ' Begin recording.
        If captureSource.VideoCaptureDevice IsNot Nothing AndAlso captureSource.State = CaptureState.Stopped Then
            captureSource.Start()
        End If

        ' Set the button states and the message.
        UpdateUI(ButtonState.Recording, "Recording...")

        ' If recording fails, display an error.
    Catch e As Exception
        Me.Dispatcher.BeginInvoke(Sub() txtDebug.Text = "ERROR: " & e.Message.ToString())
    End Try
End Sub

How would I then query that collection and allow the user to select that video for viewing in a listview? Is there no way to specify a folder to keep the video files organized?

Just looking for some advice on best practices to get this done. I wanted to use a video chooser that would allow the user to choose a video from their photo roll, but Windows Phone doesn't currently allow this.....

Johan Falk
  • 4,341
  • 2
  • 30
  • 42
Jarrette
  • 1,085
  • 2
  • 16
  • 40

1 Answers1

1

Well, is there any need to use a folder? noone can browse the ISO storage, so I see no need for folders :).

Using that tutorial, two files are created: "CameraMovie.mp4" and "CameraMovie.mp4.jpg" (the jpg is at least created on my phone, use ISETool to see the content of the ISO storage).

To record multiple videos, you would have to rename the filename each time

private string isoVideoFileName = "CameraMovie.mp4";

// reset the name when the recording starts
isoVideoFileName = DateTime.Now.ToString("yyyy-MM-dd_HH_mm") + ".mp4";

just change that variable when you start recording.

At the end of each recording, add the name of the video to a list, and once a video is added, you save the list (also to the ISO storage). While loading the app, you load the list from the ISO, use the jpg's to make video tiles (or w/e you wanna do with it ;))

Hope this will help you a little forward, if not you have found the solution yet.

note, im sorry for using C#, whereas you use VB. It is however that i dont know VB well enough to type it at will ;)

Jeffrey
  • 1,766
  • 2
  • 24
  • 44