SynchronizationVideo.cs 779 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class SynchronizationVideo : MonoBehaviour
  5. {
  6. private AVProVideoPlayer AvideoPlayer;
  7. private void Start()
  8. {
  9. AvideoPlayer = GetComponent<AVProVideoPlayer>();
  10. MultiPlayerManager.Instance.OnSynVideo += OnSyncVideo;
  11. }
  12. private void OnSyncVideo(SyncVideoData syncVideo)
  13. {
  14. if (syncVideo.isPlay)
  15. AvideoPlayer.Play();
  16. else
  17. AvideoPlayer.Pause();
  18. if (syncVideo.times != -1)
  19. AvideoPlayer.SetSeek(syncVideo.times);
  20. }
  21. public void SendSyncVideo()
  22. {
  23. }
  24. public void IsPlay()
  25. {
  26. }
  27. public void isPause()
  28. {
  29. }
  30. public void SetSeek( float times)
  31. {
  32. }
  33. }