我正在制作一个视频录制应用程序。视频被录制并存储在隔离存储中,但我想让用户将他的视频从手机上传输出来……也许将视频传输到手机的“音乐+视频”部分或通过其他方式。
隔离存储视频代码:
// File details for storing the recording.
private IsolatedStorageFileStream isoVideoFile;
private void StartVideoRecording()
{
try
{
videos = null;
isoVideoFileName = string.Format(dateTime.Day.ToString() + dateTime.Month.ToString() + dateTime.Year.ToString() + "_" + dateTime.Hour.ToString() + dateTime.Minute.ToString() + dateTime.Second.ToString()+".mp4");
//SAVE TO LOCAL MEMORY............
videos.Add(isoVideoFileName.ToString());
IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
if (settings.Contains("Storage"))
{
List<string> vids = new List<string>();
List<string> vids1 = new List<string>();
vids.AddRange(IsolatedStorageSettings.ApplicationSettings["Storage"] as List<string>);
videos.AddRange(vids);
settings["Storage"] = videos;
settings.Save();
}
else
{
settings["Storage"] = videos;
settings.Save();
}
//.......................................
if (captureSource.VideoCaptureDevice != null
&& captureSource.State == CaptureState.Started)
{
captureSource.Stop();
fileSink.CaptureSource = captureSource;
fileSink.IsolatedStorageFileName = isoVideoFileName;
}
// Begin recording.
if (captureSource.VideoCaptureDevice != null
&& captureSource.State == CaptureState.Stopped)
{
captureSource.Start();
}
disp.Text = "DashCam - Recording...";
status = "recording";
}
catch (Exception e)
{
//this.Dispatcher.BeginInvoke(delegate()
//{
// MessageBox.Show(e.ToString());
//
//});
}
}
更新 1
在解决这个问题时,我发现文档中提供的 ID_CAP_MEDIALIB_VIDEO 使我们能够将视频传输到相机胶卷。但是清单丢失了,那么还有其他方法可以使这成为可能吗?