diff --git a/Assets/Scripts.meta b/Assets/Scripts.meta new file mode 100644 index 0000000..d1d7e75 --- /dev/null +++ b/Assets/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a4cb8d90f9f1bea63a875f2f3d12e993 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/VideoPlayerManager.cs b/Assets/Scripts/VideoPlayerManager.cs new file mode 100644 index 0000000..9cc3179 --- /dev/null +++ b/Assets/Scripts/VideoPlayerManager.cs @@ -0,0 +1,52 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine.Video; //Must be using UnityEngine.Video +using UnityEngine; + +public class VideoPlayerManager : MonoBehaviour +{ + public VideoPlayer videoPlayer; //Our video player component variable. Can be set in inspector or through code in Start() + public VideoClip[] clips; //Array for video clips + + + + // Start is called before the first frame update + void Start() + { + + videoPlayer = GetComponent(); //Stores our video player component into our videoPlayer variable + + } + + + private void Update() + { + //Check to see if the current clip has ended. Once it's over, call to PlayClip() + if ((videoPlayer.frame) > 0 && (videoPlayer.isPlaying == false)) + { + PlayClip(); + } + } + + public void PlayClip() + { + if (videoPlayer.clip == clips[0]) //Checks to see if the clip that just played was the first video + { + int randClip = Random.Range(1, 3); //Randomly picks one of the remaining three videos + videoPlayer.clip = clips[randClip]; //Sets the videoPlayer clip to the next chosen video + } + else if(videoPlayer.clip == clips[1] || videoPlayer.clip == clips[2] || videoPlayer.clip == clips[3]){ + videoPlayer.clip = clips[4]; // play the last clip + } + else + { + videoPlayer.clip = clips[0]; //If the last played video wasn't the first video, then go back to playing that first video + } + + } + + +} + + + diff --git a/Assets/Scripts/VideoPlayerManager.cs.meta b/Assets/Scripts/VideoPlayerManager.cs.meta new file mode 100644 index 0000000..f0d0625 --- /dev/null +++ b/Assets/Scripts/VideoPlayerManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 640f865f39e1d47c9b2502e979868765 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VideoClips.meta b/Assets/VideoClips.meta new file mode 100644 index 0000000..0d37e10 --- /dev/null +++ b/Assets/VideoClips.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 81aae1cee259b1ab9a69f8faa177d72a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VideoClips/cat.webm b/Assets/VideoClips/cat.webm new file mode 100644 index 0000000..79b82c5 Binary files /dev/null and b/Assets/VideoClips/cat.webm differ diff --git a/Assets/VideoClips/cat.webm.meta b/Assets/VideoClips/cat.webm.meta new file mode 100644 index 0000000..9308783 --- /dev/null +++ b/Assets/VideoClips/cat.webm.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: bd3717e5581a43f2ea1629c73a163135 +VideoClipImporter: + externalObjects: {} + serializedVersion: 2 + frameRange: 0 + startFrame: -1 + endFrame: -1 + colorSpace: 0 + deinterlace: 0 + encodeAlpha: 0 + flipVertical: 0 + flipHorizontal: 0 + importAudio: 1 + targetSettings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VideoClips/emotion.webm b/Assets/VideoClips/emotion.webm new file mode 100644 index 0000000..13b441e Binary files /dev/null and b/Assets/VideoClips/emotion.webm differ diff --git a/Assets/VideoClips/emotion.webm.meta b/Assets/VideoClips/emotion.webm.meta new file mode 100644 index 0000000..a06666c --- /dev/null +++ b/Assets/VideoClips/emotion.webm.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 1bf2926887e8b9c04950fe3e37e793b2 +VideoClipImporter: + externalObjects: {} + serializedVersion: 2 + frameRange: 0 + startFrame: -1 + endFrame: -1 + colorSpace: 0 + deinterlace: 0 + encodeAlpha: 0 + flipVertical: 0 + flipHorizontal: 0 + importAudio: 1 + targetSettings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VideoClips/manyErrors.webm b/Assets/VideoClips/manyErrors.webm new file mode 100644 index 0000000..fa69c1f Binary files /dev/null and b/Assets/VideoClips/manyErrors.webm differ diff --git a/Assets/VideoClips/manyErrors.webm.meta b/Assets/VideoClips/manyErrors.webm.meta new file mode 100644 index 0000000..88b48a8 --- /dev/null +++ b/Assets/VideoClips/manyErrors.webm.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 20882a4e0a23a94328050cfaf296aef4 +VideoClipImporter: + externalObjects: {} + serializedVersion: 2 + frameRange: 0 + startFrame: -1 + endFrame: -1 + colorSpace: 0 + deinterlace: 0 + encodeAlpha: 0 + flipVertical: 0 + flipHorizontal: 0 + importAudio: 1 + targetSettings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VideoClips/neutral.webm b/Assets/VideoClips/neutral.webm new file mode 100644 index 0000000..5fbd9d6 Binary files /dev/null and b/Assets/VideoClips/neutral.webm differ diff --git a/Assets/VideoClips/neutral.webm.meta b/Assets/VideoClips/neutral.webm.meta new file mode 100644 index 0000000..d28deae --- /dev/null +++ b/Assets/VideoClips/neutral.webm.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 84a18ffb520321a55a93df7f4a5924be +VideoClipImporter: + externalObjects: {} + serializedVersion: 2 + frameRange: 0 + startFrame: -1 + endFrame: -1 + colorSpace: 0 + deinterlace: 0 + encodeAlpha: 0 + flipVertical: 0 + flipHorizontal: 0 + importAudio: 1 + targetSettings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VideoClips/tea.webm b/Assets/VideoClips/tea.webm new file mode 100644 index 0000000..4410306 Binary files /dev/null and b/Assets/VideoClips/tea.webm differ diff --git a/Assets/VideoClips/tea.webm.meta b/Assets/VideoClips/tea.webm.meta new file mode 100644 index 0000000..09cd4dc --- /dev/null +++ b/Assets/VideoClips/tea.webm.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ed8f71491616f4f5cbd476141cf177eb +VideoClipImporter: + externalObjects: {} + serializedVersion: 2 + frameRange: 0 + startFrame: -1 + endFrame: -1 + colorSpace: 0 + deinterlace: 0 + encodeAlpha: 0 + flipVertical: 0 + flipHorizontal: 0 + importAudio: 1 + targetSettings: {} + userData: + assetBundleName: + assetBundleVariant: