| | 1 | | using System.Collections.Generic; |
| | 2 | |
|
| | 3 | | namespace DCL.ECSComponents |
| | 4 | | { |
| | 5 | | public static class PBVideoPlayer_Defaults |
| | 6 | | { |
| | 7 | | public static float GetVolume(this PBVideoPlayer self) |
| | 8 | | { |
| 11 | 9 | | return self.HasVolume ? self.Volume : 1.0f; |
| | 10 | | } |
| | 11 | |
|
| | 12 | | public static bool IsPlaying(this PBVideoPlayer self) |
| | 13 | | { |
| 10 | 14 | | return self.HasPlaying && self.Playing; // default: playing=false |
| | 15 | | } |
| | 16 | |
|
| | 17 | | public static float GetPlaybackRate(this PBVideoPlayer self) |
| | 18 | | { |
| 8 | 19 | | return self.HasPlaybackRate ? self.PlaybackRate : 1.0f; |
| | 20 | | } |
| | 21 | |
|
| | 22 | | public static float GetPosition(this PBVideoPlayer self) |
| | 23 | | { |
| 9 | 24 | | return self.HasPosition ? self.Position : 0.0f; |
| | 25 | | } |
| | 26 | |
|
| | 27 | | public static bool GetLoop(this PBVideoPlayer self) |
| | 28 | | { |
| 8 | 29 | | return self.HasLoop && self.Loop; // default: loop=false |
| | 30 | | } |
| | 31 | |
|
| | 32 | | public static string GetVideoUrl(this PBVideoPlayer self, ContentProvider sceneContentProvider, |
| | 33 | | IReadOnlyList<string> sceneRequiredPermissions, IReadOnlyList<string> sceneAllowedMediaHostnames) |
| | 34 | | { |
| 8 | 35 | | UtilsScene.TryGetMediaUrl(self.Src, sceneContentProvider, |
| | 36 | | sceneRequiredPermissions, sceneAllowedMediaHostnames, out string url); |
| | 37 | |
|
| 8 | 38 | | return url; |
| | 39 | | } |
| | 40 | | } |
| | 41 | | } |