Skip to content

Commit 21dbb4e

Browse files
authored
CU-868f2gyjp: Add Sample Video For Editor Testing (#207)
### TL;DR Added sample video and content for editor mode in the Video content type. ### What changed? - Updated the `GetFullVideoFilePath()` method in the `Video` class to return a sample video path when running in the Unity Editor - Added a check for `Application.isEditor` that returns a predefined sample video path - Added `UnityEngine` namespace import to support the `Application` class - Updated the Files.zip binary file to add a sample video ### Sample Video The sample video is Big Buck Bunny; likely one of the most commonly used videos for testing purposes. Created by Blender in 2008 - it's open license, high quality and family friendly content was setup specifically for this use case. For more details see here: https://peach.blender.org/about/
1 parent 7269867 commit 21dbb4e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Assets/MXR.SDK/Files.zip

245 KB
Binary file not shown.

Assets/MXR.SDK/Runtime/Types/ContentTypes.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using Newtonsoft.Json;
55
using Newtonsoft.Json.Converters;
6+
using UnityEngine;
67

78
namespace MXR.SDK {
89
/// <summary>
@@ -157,6 +158,10 @@ public class Video : Content {
157158
public string videoPath;
158159

159160
public string GetFullVideoFilePath() {
161+
if (Application.isEditor) {
162+
return MXRStorage.GetFullPath("/MightyImmersion/videos/sample.mp4");
163+
}
164+
160165
if (string.IsNullOrEmpty(videoPath)) {
161166
return null;
162167
}
@@ -255,4 +260,4 @@ public class RuntimeApp : Content {
255260
/// </summary>
256261
public long expirationTimestamp;
257262
}
258-
}
263+
}

0 commit comments

Comments
 (0)