I am using C++ and XAML to develop an UI application. There is a point in the execution that I use a CameraCaptureUI to record a video. The code looks like this:
CameraCaptureUI^ dialog = ref new CameraCaptureUI();
dialog->VideoSettings->Format = CameraCaptureUIVideoFormat::Mp4;
concurrency::task<StorageFile^>(dialog->CaptureFileAsync(CameraCaptureUIMode::Video)).then([this](StorageFile^ file) {
if (file != nullptr) {
concurrency::task<Streams::IRandomAccessStream^>(file->OpenAsync(FileAccessMode::Read)).then([this](Streams::IRandomAccessStream^ stream) {
// CapturedVideo->SetSource(stream, "video/mp4");
logger->Text = "grabando";
});
Windows::Foundation::Collections::IPropertySet^ appSettings = ApplicationData::Current->LocalSettings->Values;
appSettings->Insert("CaptureVideo", PropertyValue::CreateString(file->Path));
});
This is all I do to it, once I record a video, it always has "CCapture(X)" as a name, being X a away to create unique names. I tried copying the file by using CopyAsync function:
create_task(StorageLibrary::GetLibraryAsync(KnownLibraryId::Videos))
.then([this](StorageLibrary^ videosLibrary)
{
Windows::Storage::StorageFolder^ _videoLib = videosLibrary->SaveFolder;
if (_videoLib == nullptr)
{
// In this case fall back to the local app storage since the Pictures Library is not available
_videoLib = ApplicationData::Current->LocalFolder;
}
});
//EtiquetaVid is a string created earlier
file->CopyAsync(_videoLib, stringToPlatformString(etiquetaVid), NameCollisionOption::GenerateUniqueName);
But I nothing appeared on my video library and there were no errors to guide me.
My question is: How can I control the name of the output video? I've searched through the documentation and forums but I can't seem to find a solution.