|
@@ -30,8 +30,8 @@ public class RemoteVideoControl : MonoBehaviour
|
|
|
|
|
|
isStart = avProVideoPlayer.IsPlaying();
|
|
|
isStart = !isStart;
|
|
|
- Icon.SetActive(!isStart.Value);
|
|
|
- Stop.SetActive(isStart.Value);
|
|
|
+
|
|
|
+
|
|
|
if (isStart.Value)
|
|
|
{
|
|
|
|
|
@@ -66,11 +66,69 @@ public class RemoteVideoControl : MonoBehaviour
|
|
|
|
|
|
float max;
|
|
|
|
|
|
+ private IEnumerator VideoState()
|
|
|
+ {
|
|
|
+ while(true)
|
|
|
+ {
|
|
|
+ yield return new WaitForSeconds(0.1f);
|
|
|
+
|
|
|
+ switch (avProVideoPlayer.GetVideoState())
|
|
|
+ {
|
|
|
+ case MediaPlayerCtrl.MEDIAPLAYER_STATE.NOT_READY:
|
|
|
+ if (!Icon.activeSelf)
|
|
|
+ {
|
|
|
+ Icon.SetActive(true);
|
|
|
+ Stop.SetActive(false);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case MediaPlayerCtrl.MEDIAPLAYER_STATE.READY:
|
|
|
+ break;
|
|
|
+ case MediaPlayerCtrl.MEDIAPLAYER_STATE.END:
|
|
|
+ if (!Icon.activeSelf)
|
|
|
+ {
|
|
|
+ Icon.SetActive(true);
|
|
|
+ Stop.SetActive(false);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case MediaPlayerCtrl.MEDIAPLAYER_STATE.PLAYING:
|
|
|
+ if (Icon.activeSelf)
|
|
|
+ {
|
|
|
+ Icon.SetActive(false);
|
|
|
+ Stop.SetActive(true);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case MediaPlayerCtrl.MEDIAPLAYER_STATE.PAUSED:
|
|
|
+ if (!Icon.activeSelf)
|
|
|
+ {
|
|
|
+ Icon.SetActive(true);
|
|
|
+ Stop.SetActive(false);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case MediaPlayerCtrl.MEDIAPLAYER_STATE.STOPPED:
|
|
|
+ if (!Icon.activeSelf)
|
|
|
+ {
|
|
|
+ Icon.SetActive(true);
|
|
|
+ Stop.SetActive(false);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case MediaPlayerCtrl.MEDIAPLAYER_STATE.ERROR:
|
|
|
+ if (!Icon.activeSelf)
|
|
|
+ {
|
|
|
+ Icon.SetActive(true);
|
|
|
+ Stop.SetActive(false);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private IEnumerator VideoTimer()
|
|
|
{
|
|
|
while (true)
|
|
|
{
|
|
|
- yield return new WaitForSeconds(0.05f);
|
|
|
+ yield return new WaitForSeconds(0.1f);
|
|
|
if (avProVideoPlayer.IsVideoReady()&& !AVideoSlide.isDown)
|
|
|
{
|
|
|
float maxTimer = avProVideoPlayer.GetMaxTimer();
|
|
@@ -79,11 +137,11 @@ public class RemoteVideoControl : MonoBehaviour
|
|
|
currentTime.text = string.Format("{0}:{1}", (nowTimer / 60).ToString("00"), (nowTimer % 60).ToString("00"));
|
|
|
slider.value = maxTimer / nowTimer;
|
|
|
|
|
|
- if (textTotalTime.text == currentTime.text)
|
|
|
- {
|
|
|
- Icon.SetActive(true);
|
|
|
- Stop.SetActive(false);
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|