public void GetMetadata_Returns_Null_When_No_Metadata_Present_In_Description() { JSONNode sampleJson = video.GetMetadata(); Assert.IsNull(sampleJson); }
public IEnumerator VideoControllerPlayVideo() { videoControllerReady = true; if (videoPlayerType == VideoPlayerType.UnityPlayer) { controller.PlayVideo(vimeoVideo, selectedResolution); } else { #if VIMEO_AVPRO_VIDEO_SUPPORT if (this.selectedResolution == StreamingResolution.Adaptive) { yield return(Unfurl(vimeoVideo.GetAdaptiveVideoFileURL())); } else { m_file_url = vimeoVideo.GetVideoFileUrlByResolution(selectedResolution); } if (videoPlayerType == VideoPlayerType.AVProVideo && mediaPlayer != null) { mediaPlayer.OpenVideoFromFile(RenderHeads.Media.AVProVideo.MediaPlayer.FileLocation.AbsolutePathOrURL, m_file_url, autoPlay || playVideoAfterLoad); } #endif // VIMEO_AVPRO_VIDEO_SUPPORT #if VIMEO_DEPTHKIT_SUPPORT if (videoPlayerType == VideoPlayerType.Depthkit && depthKitClip != null) { #if VIMEO_AVPRO_VIDEO_SUPPORT if (depthKitClip.gameObject.GetComponent <RenderHeads.Media.AVProVideo.MediaPlayer>() != null) { depthKitClip.gameObject.GetComponent <RenderHeads.Media.AVProVideo.MediaPlayer>().OpenVideoFromFile(RenderHeads.Media.AVProVideo.MediaPlayer.FileLocation.AbsolutePathOrURL, m_file_url, autoPlay); } #endif // VIMEO_AVPRO_VIDEO_SUPPORT if (depthKitClip.gameObject.GetComponent <VideoPlayer>() != null) { if (this.selectedResolution != StreamingResolution.Adaptive) { depthKitClip.gameObject.GetComponent <VideoPlayer>().url = vimeoVideo.GetVideoFileUrlByResolution(selectedResolution); } else { Debug.LogError("[Vimeo] Unity video player does not support adaptive video try selecting a specific quality in the Vimeo Player or use AVPro video on the Depthkit clip"); } } #if UNITY_2018_OR_NEWER JSONNode metadata = vimeoVideo.GetMetadata(); if (metadata != null) { depthKitClip._metaDataFile = new TextAsset(metadata.ToString()); depthKitClip._needToRefreshMetadata = true; // This is a temporary hack to trigger the OnVideoStart event once the metadata loaded and will be replaced in the future if (OnVideoStart != null) { OnVideoStart(); } } else { if (OnLoadError != null) { OnLoadError(); } } #else Debug.LogError("[Vimeo] The Depthkit integration currently only supports Unity 2018 and higher"); #endif } #endif // VIMEO_DEPTHKIT_SUPPORT } yield break; }