Fix memory bug in looping videos
This commit is contained in:
parent
2b8fab7d24
commit
3899960b5c
@ -93,6 +93,7 @@ public class NamedDepthkitPlayer : ComponentHandler {
|
||||
//depthkitClip.Player.StartVideoLoad();
|
||||
|
||||
//StartCoroutine(depthkitClip.player.LoadAndPlay());
|
||||
|
||||
depthkitClip.player.Play();
|
||||
|
||||
//GetComponent<RenderHeads.Media.AVProVideo.MediaPlayer>().Rewind(false);
|
||||
@ -163,20 +164,38 @@ public class NamedDepthkitPlayer : ComponentHandler {
|
||||
if (depthkitClip.player.IsPlaying())
|
||||
{
|
||||
depthkitClip.player.Stop();
|
||||
mediaPlayer.CloseMedia();
|
||||
}
|
||||
mediaPlayer.CloseMedia();
|
||||
}
|
||||
|
||||
gameObject.SetActive(false);
|
||||
goto case NodeState.Running;
|
||||
case NodeState.Running:
|
||||
Task.SetSucceeded();
|
||||
break;
|
||||
|
||||
/* case NodeState.Running:
|
||||
if (mediaPlayer != null)
|
||||
{
|
||||
if (!mediaPlayer.MediaOpened && !depthkitClip.player.IsPlaying())
|
||||
{
|
||||
Debug.Log("MEDIA IS CLOSED!!!");
|
||||
gameObject.SetActive(false);
|
||||
Task.SetSucceeded();
|
||||
}
|
||||
else
|
||||
{
|
||||
depthkitClip.player.Stop();
|
||||
mediaPlayer.CloseMedia();
|
||||
}
|
||||
}
|
||||
break;
|
||||
*/
|
||||
case NodeState.Aborting:
|
||||
if (mediaPlayer != null)
|
||||
{
|
||||
mediaPlayer.CloseMedia();
|
||||
}
|
||||
break;
|
||||
case NodeState.NotRunning:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user