Added a small delay to video loading, which seems to load them more reliably.
This commit is contained in:
parent
380df620cf
commit
7b9d6c08e6
@ -1,10 +1,8 @@
|
||||
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDK3.Components.Video;
|
||||
using VRC.SDK3.Image;
|
||||
using VRC.SDK3.UdonNetworkCalling;
|
||||
using VRC.SDK3.Video.Components.Base;
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon.Common;
|
||||
using VRC.Udon.Common.Interfaces;
|
||||
@ -152,10 +150,10 @@ public class CaseVideoSyncPlayer : UdonSharpBehaviour
|
||||
_CaseVideoListCache = (VRCUrl[])_CaseVideoList.Clone();
|
||||
}
|
||||
|
||||
if (_VideoIndex != _OldVideoIndex)
|
||||
{
|
||||
_LoadNewVideoIndex();
|
||||
}
|
||||
//if (_VideoIndex != _OldVideoIndex)
|
||||
//{
|
||||
// _LoadNewVideoIndex();
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
@ -303,21 +301,20 @@ public class CaseVideoSyncPlayer : UdonSharpBehaviour
|
||||
//_VideoLoadAttemptCounter = 0;
|
||||
|
||||
//_UseFallback = false;
|
||||
_LoadVideo_Private();
|
||||
}
|
||||
|
||||
private void _LoadVideo_Private()
|
||||
{
|
||||
TryLoadURL();
|
||||
}
|
||||
public void TryLoadURL()
|
||||
{
|
||||
if (_VideoIndex >= 0 && _VideoIndex < _CaseVideoList.Length)
|
||||
{
|
||||
_VideoPlayer.LoadURL(_CaseVideoList[_VideoIndex]);
|
||||
SetVideoLoadStatus(IndicationStatus.Loading);
|
||||
SendCustomEventDelayedSeconds(nameof(LoadNewVideoURL), 0.2f);
|
||||
}
|
||||
}
|
||||
public void LoadNewVideoURL()
|
||||
{
|
||||
_VideoPlayer.LoadURL(_CaseVideoList[_VideoIndex]);
|
||||
}
|
||||
|
||||
private void _PlayVideo_Private()
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user