gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 13:30:59 24 4
gpt4 key购买 nike

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

隔离存储视频代码:

// 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com