ShowVideoManager.cs 502 B

123456789101112131415161718192021222324252627
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class ShowVideoManager : MonoBehaviour
  5. {
  6. public string url;
  7. AVProVideoPlayer avpro;
  8. private void OnEnable()
  9. {
  10. if(url!=null&& url!="")
  11. {
  12. avpro = this.GetComponent<AVProVideoPlayer>();
  13. avpro.SetUrl(url);
  14. avpro.Play();
  15. }
  16. }
  17. private void OnDisable()
  18. {
  19. if(avpro!=null)
  20. {
  21. avpro.Stop();
  22. }
  23. }
  24. }