c# - 从隔离存储中将视频从手机传输出去

标签 c# video windows-phone-8 isolatedstorage isolatedstoragefile

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

隔离存储视频代码:

// 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 使我们能够将视频传输到相机胶卷。但是缺少 list ,那么还有其他方法可以实现吗?

最佳答案

关于c# - 从隔离存储中将视频从手机传输出去,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20568036/

相关文章:

c# - 简单注入(inject)器/IoC - 队列处理器的 Windows 服务和请求周期

javascript - canvas.toDataURL() 安全错误操作不安全

Facebook Messenger Bot : Size of Video Attachment? 它有多大?

windows-phone-8 - 通用 Windows 平台 (Win10) 和 Windows Phone 编程之间的区别?

javascript - 导航到 Windows 应用商店应用程序中的另一个 html

c# - 如何将文件写入 Internet Explorer Mobile 的响应?

c# - "Can' t 在指定文件夹中找到 .NET 程序集 {AssemblyName}”

c# - 仅适用于 ie8 的复选框样式表

c# - 如何在 .net core 中读取无键查询字符串

php - 轮播播放列表中的缩略图顺序