IVideoPlayer.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using UnityEngine;
  2. namespace Nfynt.WVP
  3. {
  4. [System.Serializable]
  5. public struct PlayerConfigs
  6. {
  7. [UnityEngine.Tooltip("Default video path of StreamingAssets is assumed if the path doesn't contain :/. Otherwise provide full system path or URL.")]
  8. public string VideoSrcPath;
  9. [UnityEngine.Tooltip("Target RenderTexture which is used in scene.")]
  10. public UnityEngine.RenderTexture VideoTextureTarget;
  11. [UnityEngine.Tooltip("Unity AudioSource component. If null then a new audio source is attached to this object.")]
  12. public UnityEngine.AudioSource AudioSource;
  13. [UnityEngine.Tooltip("Autoplay video on start. Note the audio source is muted on browser in this mode.")]
  14. public bool PlayOnAwake;
  15. [UnityEngine.Tooltip("True by default on web build. Useful for editor testing.")]
  16. public bool MuteAsDefault;
  17. [UnityEngine.Tooltip("Player video in loop")]
  18. public bool LoopPlayer;
  19. [Tooltip("Mapping for video texture to unity RTT")]
  20. public UnityEngine.Video.VideoAspectRatio VideoAspectRatio;
  21. };
  22. internal interface IVideoPlayer
  23. {
  24. public void InitializePlayer(PlayerConfigs config);
  25. public void ReleasePlayer();
  26. public bool PlayStopVideo(PlayerConfigs config, bool play);
  27. public bool PauseResumeVideo(bool pause);
  28. public bool MuteUnmuteVideo(bool mute);
  29. public bool IsPlaying();
  30. public bool IsMuted();
  31. public double VideoDuration();
  32. public double CurrFrameTime();
  33. public bool SetFrameTime(double timeInSec);
  34. public Vector2 FrameSize();
  35. }
  36. }