IWithFallbackVideo.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Copyright (c) 2024 Vuplex Inc. All rights reserved.
  2. //
  3. // Licensed under the Vuplex Commercial Software Library License, you may
  4. // not use this file except in compliance with the License. You may obtain
  5. // a copy of the License at
  6. //
  7. // https://vuplex.com/commercial-library-license
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. using System;
  15. using UnityEngine;
  16. namespace Vuplex.WebView {
  17. /// <summary>
  18. /// Interface used on iOS for the
  19. /// <seealso href="https://support.vuplex.com/articles/fallback-video">fallback video implementation</seealso>.
  20. /// </summary>
  21. public interface IWithFallbackVideo {
  22. /// <summary>
  23. /// Indicates whether the fallback video implementation is enabled.
  24. /// </summary>
  25. bool FallbackVideoEnabled { get; }
  26. /// <summary>
  27. /// Indicates that the rect of the playing video changed.
  28. /// </summary>
  29. event EventHandler<EventArgs<Rect>> VideoRectChanged;
  30. /// <summary>
  31. /// The video texture used for the fallback video implementation, or `null`
  32. /// if the fallback video implementation is not enabled.
  33. /// </summary>
  34. Texture2D VideoTexture { get; }
  35. /// <summary>
  36. /// Returns a Material that can be used for displaying the VideoTexture.
  37. /// </summary>
  38. Material CreateVideoMaterial();
  39. /// <summary>
  40. /// Sets whether the fallback video implementation is enabled. The default is `false`.
  41. /// </summary>
  42. void SetFallbackVideoEnabled(bool enabled);
  43. }
  44. }