Hi, i am using the playback functionality of AR Core Extensions my code is as follows
bool setPlaybackDataset = false;
float timeout;
Uri datasetUri;
public void loadSceneMP4(string path)
{
setPlaybackDataset = true;
m_Session.enabled = false;
timeout = 30f;
Debug.Log("Path mp4 "+ path);
if(File.Exists(@path)){
Debug.Log("Si Existe archivo");
}
else {
Debug.Log("No existe archivo");
}
//datasetUri = new System.Uri("file://"+path);
bool result = Uri.TryCreate(@"file://"+path, UriKind.Absolute, out datasetUri)
&& (datasetUri.Scheme == Uri.UriSchemeFile);
if (result)
Debug.Log("Uri valida");
else
Debug.Log("Uri invalida");
Debug.Log("URI DIR: "+ datasetUri.LocalPath);
}
void Update(){
if (setPlaybackDataset){
PlaybackResult result = playbackManager.SetPlaybackDatasetUri(datasetUri);
if (result == PlaybackResult.ErrorPlaybackFailed){
timeout -= Time.deltaTime;
Debug.Log("Session error playback");
}
else if (result == PlaybackResult.SessionNotReady){
timeout -= Time.deltaTime;
Debug.Log("SessionNotReady");
}
else if(result == PlaybackResult.ErrorSessionUnsupported){
Debug.Log("ErrorSessionUnsupported");
}
else if(result == PlaybackResult.ErrorSessionNotPaused){
Debug.Log("ErrorSessionNotPaused");
}
else{
timeout = -1f;
}
if (timeout < 0.0f)
{
m_Session.enabled = true;
setPlaybackDataset = false;
//error o se logro
}
}
}
Variable path is called and has the following value “/device_storage/DCIM/ARproject/videos/17-08-2022-18-05-50.mp4”
at first it says SessionNotReady then after a few seconds throws this error
Playback dataset failed with unexpected status: ErrorFatal
Google.XR.ARCoreExtensions.Internal.Translators:ToPlaybackResult(ApiArStatus)
ScreenR2:Update()
For some reason when i try File.Exists( @ ) it says that file doesnt exists, i already try to put a “@” to file path but that doesnt work either, but when i try Uri.TryCreate and the other stuff, it says uri is correct.
The file mp4 is in the directory, directory is correct… but for some reason i cant make it work, also i verified the “file://” of android (it only has two because my path variable starts with a “/”) and is correct, i already search but i didnt find any info so i am asking here if anyone knows a solution, thanks.