Esempio n. 1
0
    void ValueChanged(float f)
    {
        if (IsVoluntary)
        {
            IsVoluntary = false;
            return;
        }

        if (SliderCheckStatusCallback != null)
        {
            SliderCheckStatusCallback(true);
        }

        long times = (long)(f * TotalTime);

        if (SeekToTimeCallback != null)
        {
            SeekToTimeCallback(times);
        }

        int seconds = (int)(times / 1000);

        CurrentTimeText.text = PreDefScrp.SecondsToHMS(seconds);

        Statistics.GetInstance().OnEvent(MediaCenterEvent.ClickOnTimeline, "点击进度条");
    }
Esempio n. 2
0
    public void SetTotalTime(long totalTime)
    {
        LogTool.Log("设置总时间:" + totalTime);
        TotalTime = totalTime;

        int seconds = (int)(totalTime / 1000);

        TotalTimeText.text = PreDefScrp.SecondsToHMS(seconds);
    }
Esempio n. 3
0
    public void SetCurrentTime(long currentTime)
    {
        int seconds = (int)(currentTime / 1000);

        CurrentTimeText.text = PreDefScrp.SecondsToHMS(seconds);

        float t = 0;

        if (TotalTime != 0)
        {
            t = (float)currentTime / TotalTime;
        }

        IsVoluntary        = true;
        PlayPBSlider.value = t;
    }
Esempio n. 4
0
    void HoverPointFollow()
    {
        Vector3 pos = GvrPointerInputModule.CurrentRaycastResult.worldPosition;
        Vector3 v   = pos - HoverPointStartPos;
        float   len = PreDefScrp.GetProjLen(v, HoverPointShowVector);

        if (len >= 0 && len < HoverPointShowVector.magnitude)
        {
            ShowOrHidePBDot(true);
            CurHoverValue = (HoverPointShowVector.normalized * len).magnitude / HoverPointShowVector.magnitude;
            long times   = (long)(CurHoverValue * TotalTime);
            int  seconds = (int)(times / 1000);
            CurHoverText.text                 = PreDefScrp.SecondsToHMS(seconds);
            PlayPBDot.transform.position      = HoverPointStartPos + HoverPointShowVector.normalized * len;
            PlayPBDot.transform.localPosition = new Vector3(PlayPBDot.transform.localPosition.x, 0, PlayPBDot.transform.localPosition.z);
        }
        else
        {
            ShowOrHidePBDot(false);
        }
    }