从独立存储设备中传输手机视频

本文关键字:手机 视频 传输 独立 存储设备 | 更新日期: 2024-09-17 01:18:32

我正在制作一个视频录制应用程序。视频被录制并存储在隔离存储中,但我想让用户能够从手机上传输他的视频。。。可能会将视频传输到手机的"音乐+视频"部分或通过其他方式。

隔离存储视频代码:

// 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,它使我们能够将视频传输到相机胶卷上。然而,清单不见了,那么有没有其他方法可以实现这一点?

从独立存储设备中传输手机视频

看看这个主题:http://developer.nokia.com/Community/Discussion/showthread.php/239630-Can-i-save-video-to-CameraRoll

关于音乐+视频中心的其他信息:http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff769558%28v=vs.105%29.aspx