Beispiel #1
0
 private void VideoPlayerPrepareCompleted(YTDLPlayer source)
 {
     loadingCircle.SetActive(false);
     if (isVideoJumping)
     {
         CalcProgressSimpleValue();
         PlayVideo();
         JumpVideo();
     }
 }
Beispiel #2
0
        private void Awake()
        {
            ytdlPlayer = GetComponent <YTDLPlayer>();
            ytdlPlayer.parseStarted     += ParseStarted;
            ytdlPlayer.started          += VideoPlayerStarted;
            ytdlPlayer.prepareCompleted += VideoPlayerPrepareCompleted;

            mainCamera = Camera.main;

            progressPosY     = progressCircle.transform.localPosition.y;
            progressBarWidth = progressBarBG.GetComponent <SpriteRenderer>().bounds.size.x;

            volumePosY     = volumeCircle.transform.localPosition.y;
            volumeBarWidth = volumeBarBG.GetComponent <SpriteRenderer>().bounds.size.x;
        }
Beispiel #3
0
        private void VideoPlayerStarted(YTDLPlayer source)
        {
            loadingCircle.SetActive(false);
            isVideoPlaying = true;
            isVideoJumping = false;
            VideoInfo videoInfo = ytdlPlayer.GetVideoInfo();
            // update video title
            string title = videoInfo.title;

            if (title.Length > VIDEO_TITLE_LENGTH_LIMIT)
            {
                title = string.Format("{0}...", title.Substring(0, VIDEO_TITLE_LENGTH_LIMIT - 3));
            }
            videoTitle.SetText(title);
            // update quality button
            if (currentFormatIndex == -1)
            {
                qualityButton.SetText(GenQualityText(videoInfo.format_note, videoInfo.height));
            }
            // toggle play button
            ToggleVideoPlayButton();
        }
Beispiel #4
0
 private void ParseStarted(YTDLPlayer source)
 {
     loadingCircle.SetActive(true);
 }