UrlVideoPlayer.cs 715 B

1234567891011121314151617181920212223242526272829
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using UnityEngine.Video;
  6. public class UrlVideoPlayer : MonoBehaviour
  7. {
  8. private RawImage rawImage;
  9. private VideoPlayer videoPlayer;
  10. // Use this for initialization
  11. void Start()
  12. {
  13. //rawImage = this.GetComponent<RawImage>();
  14. videoPlayer = this.GetComponent<VideoPlayer>();
  15. videoPlayer.url =
  16. "http://shvber.com:5028/Download/AttachFiles/Train/Camp/3a9541b69788b1cd5518a31bf4a882f0-210817232854225.mp4";
  17. videoPlayer.Play();
  18. }
  19. // Update is called once per frame
  20. void Update()
  21. {
  22. //rawImage.texture = videoPlayer.texture;
  23. }
  24. }