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();
|
//depthkitClip.Player.StartVideoLoad();
|
||||||
|
|
||||||
//StartCoroutine(depthkitClip.player.LoadAndPlay());
|
//StartCoroutine(depthkitClip.player.LoadAndPlay());
|
||||||
|
|
||||||
depthkitClip.player.Play();
|
depthkitClip.player.Play();
|
||||||
|
|
||||||
//GetComponent<RenderHeads.Media.AVProVideo.MediaPlayer>().Rewind(false);
|
//GetComponent<RenderHeads.Media.AVProVideo.MediaPlayer>().Rewind(false);
|
||||||
@ -163,20 +164,38 @@ public class NamedDepthkitPlayer : ComponentHandler {
|
|||||||
if (depthkitClip.player.IsPlaying())
|
if (depthkitClip.player.IsPlaying())
|
||||||
{
|
{
|
||||||
depthkitClip.player.Stop();
|
depthkitClip.player.Stop();
|
||||||
|
mediaPlayer.CloseMedia();
|
||||||
}
|
}
|
||||||
mediaPlayer.CloseMedia();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gameObject.SetActive(false);
|
gameObject.SetActive(false);
|
||||||
goto case NodeState.Running;
|
|
||||||
case NodeState.Running:
|
|
||||||
Task.SetSucceeded();
|
Task.SetSucceeded();
|
||||||
break;
|
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:
|
case NodeState.Aborting:
|
||||||
|
if (mediaPlayer != null)
|
||||||
|
{
|
||||||
|
mediaPlayer.CloseMedia();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case NodeState.NotRunning:
|
case NodeState.NotRunning:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user