AutoPlayer.cs 570 B

12345678910111213141516171819202122232425
  1. using Nfynt;
  2. using UnityEngine;
  3. public class AutoPlayer : MonoBehaviour
  4. {
  5. public NVideoPlayer VidPlayer = null;
  6. public string url = "";
  7. // Start is called once before the first execution of Update after the MonoBehaviour is created
  8. void Start()
  9. {
  10. //Invoke("SetSourceUrl",3f);
  11. }
  12. public void SetSourceUrl()
  13. {
  14. VidPlayer.Stop();
  15. VidPlayer.Config.VideoSrcPath = "https://wx-model-1317557471.cos.ap-shanghai.myqcloud.com/unity6test/StreamingAssets/" +url+".mp4";
  16. Invoke("PlayPauseBtn", 1f);
  17. }
  18. public void PlayPauseBtn()
  19. {
  20. VidPlayer.Play();
  21. }
  22. }