コード例 #1
0
 public void GetAdaptiveVideoFileURL_Returns_Correct_Adaptive_Manifest_Based_On_Platform()
 {
     if (isApple())
     {
         Assert.AreEqual(video.GetAdaptiveVideoFileURL(), video.getHlsUrl());
     }
     else
     {
         Assert.AreEqual(video.GetAdaptiveVideoFileURL(), video.getDashUrl());
     }
 }
コード例 #2
0
        private void VideoControllerPlayVideo()
        {
            videoControllerReady = true;

            if (videoPlayerType == VideoPlayerType.UnityPlayer)
            {
                controller.PlayVideo(vimeoVideo, selectedResolution);
            }
            else
            {
#if VIMEO_AVPRO_VIDEO_SUPPORT
                string file_url = null;

                if (this.selectedResolution == StreamingResolution.Adaptive)
                {
                    file_url = vimeoVideo.GetAdaptiveVideoFileURL();
                }
                else
                {
                    file_url = vimeoVideo.GetVideoFileUrlByResolution(selectedResolution);
                }

                if (videoPlayerType == VideoPlayerType.AVProVideo && mediaPlayer != null)
                {
                    mediaPlayer.OpenVideoFromFile(RenderHeads.Media.AVProVideo.MediaPlayer.FileLocation.AbsolutePathOrURL, file_url, autoPlay || playVideoAfterLoad);
                }
#if VIMEO_DEPTHKIT_SUPPORT
                // TODO
                else if (videoPlayerType == VideoPlayerType.DepthKit && depthKitClip != null)
                {
                    // depthKitClip._moviePath = file_url;
                    // depthKitClip._metaDataText = vimeoVideo.description;
                    // depthKitClip.GetComponent<RenderHeads.Media.AVProVideo.MediaPlayer>().OpenVideoFromFile(RenderHeads.Media.AVProVideo.MediaPlayer.FileLocation.AbsolutePathOrURL, file_url, autoPlay);
                    // depthKitClip.RefreshRenderer();
                }
    #endif
#endif
            }
        }
コード例 #3
0
 // TODO somehow test different application platforms
 // Note: this fails (correctly) when testing on Mac
 public void GetAdaptiveVideoFileURL_Defaults_To_Hls_For_Files_Response()
 {
     UnityEngine.TestTools.LogAssert.Expect(LogType.Warning, "[Vimeo] No DASH manfiest found. Defaulting to HLS.");
     video = new VimeoVideo(JSONNode.Parse(mockProductionJson));
     Assert.AreEqual(video.GetAdaptiveVideoFileURL(), video.getHlsUrl());
 }
コード例 #4
0
 // TODO somehow test different application platforms
 // Note: this fails (correctly) when testing on Mac
 public void GetAdaptiveVideoFileURL_Returns_Dash_By_Default()
 {
     Assert.AreEqual(video.GetAdaptiveVideoFileURL(), video.getDashUrl());
 }
コード例 #5
0
        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;
        }