示例#1
0
    /// <summary>
    /// 本地MediaPlayer调用播放
    /// </summary>
    /// <param name="videoIndex"></param>
    void PlayNewVideo(int videoIndex)
    {
        Cinema.IsPlayOrPauseVideoPlayer = true;
        CurJVideoInfo = null;
        JVideoDescriptionInfo jVdi = PlayerDataControl.GetInstance().GetJVideoDscpInfoByIndex(videoIndex);

        if (jVdi == null)
        {
            return;
        }

        //shemi
        //LocalVideosPanel.VideosViewPanel.ResetCurVideoId(jVdi.id);
        PlayNewVideoBase(jVdi);

        //没有识别过立体格式&&底层没有传送格式&&格式识别的图片不是null
        if ((jVdi.stereoType < 0 || jVdi.stereoType > 8) &&
            !VideoFormatDictionaryDetector.GetInstance().HasVideoFormatOrNotByVideoId(jVdi.id.ToString()) &&
            jVdi.recognitionImagePath != null)
        {
            StartCoroutine(/*Cinema.VideoManage.MediaManage.*/ GlobalRunningFunction.Instance.LoadImageAndAnalyze.StartAnalyzeImageThread(jVdi.id, jVdi.recognitionImagePath));
        }
        else
        {
            PlayVideoAfterAnalyze(videoIndex, null);
        }
    }
示例#2
0
    void ChangeStereoType(StereoType stereoType)
    {
        if (/*!GlobalVariable.IsIntent && */ !IsPlayLoop)
        {
            if (PlayerDataControl.GetInstance().CurPlayingMode == PlayingURLMode.Local)
            {
                VideoFormatDictionaryDetector.GetInstance().SetVideoFormatTypeByVideoId(CurJVideoInfo.id.ToString(), (int)stereoType);
            }
            else if (PlayerDataControl.GetInstance().CurPlayingMode == PlayingURLMode.KTTV)
            {
                VideoFormatDictionaryDetector.GetInstance().SetVideoFormatTypeByVideoId
                    (string.Format("{0}-{1}", CurJVideoInfo.vid, CurJVideoInfo.cid), (int)stereoType);
            }
            else if (PlayerDataControl.GetInstance().CurPlayingMode == PlayingURLMode.LiveUrl)
            {
                VideoFormatDictionaryDetector.GetInstance().SetVideoFormatTypeByVideoId(CurJVideoInfo.uri, (int)stereoType);
            }
        }
        else if (IsPlayLoop)
        {
            VideoPlayerPanel.SetVideoFormatTypeWhenPlayLoop((int)stereoType);
        }

        if (CurJVideoInfo != null)
        {
            CurJVideoInfo.stereoType = (int)stereoType;
        }
        Cinema.VideoPlayer.SetPlayMode(stereoType);
        ImaxPurpleControlByStereoType(stereoType);
        WindowStereoTypeUIReset();
    }
 public void OnApplicationPause(bool pause)
 {
     if (pause)
     {
         VideoFormatDictionaryDetector.GetInstance().SaveVideoFormatTypeDic();
         ImageFormatDictionaryDetector.GetInstance().SaveImageFormatTypeDic();
     }
 }
示例#4
0
    public void SetVideoFormatTypeWhenPlayLoop(int stereoType)
    {
        if (!CinemaPanel.IsPlayLoop)
        {
            return;
        }

        VideoFormatDictionaryDetector.GetInstance().SetVideoFormatTypeByVideoId(CurJVideoDscpInfo.id.ToString(), (int)stereoType);
    }
示例#5
0
    void SetStereoTypeForUI(int stereoType = -1)
    {
        int type;

        if (stereoType == -1)
        {
            type = CurJVideoInfo.stereoType;
            if (type > 8)
            {
                type = 6;
            }

            if (PlayerDataControl.GetInstance().CurPlayingMode == PlayingURLMode.Local)
            {
                if (VideoFormatDictionaryDetector.GetInstance().HasVideoFormatOrNotByVideoId(CurJVideoInfo.id.ToString()))
                {
                    type = VideoFormatDictionaryDetector.GetInstance().GetVideoFormatTypeByVideoId(CurJVideoInfo.id.ToString());
                }
            }
            else if (PlayerDataControl.GetInstance().CurPlayingMode == PlayingURLMode.KTTV)
            {
                string id = string.Format("{0}-{1}", CurJVideoInfo.vid, CurJVideoInfo.cid);
                if (VideoFormatDictionaryDetector.GetInstance().HasVideoFormatOrNotByVideoId(id))
                {
                    type = VideoFormatDictionaryDetector.GetInstance().GetVideoFormatTypeByVideoId(id);
                }
            }
            else if (PlayerDataControl.GetInstance().CurPlayingMode == PlayingURLMode.LiveUrl)
            {
                if (VideoFormatDictionaryDetector.GetInstance().HasVideoFormatOrNotByVideoId(CurJVideoInfo.uri))
                {
                    type = VideoFormatDictionaryDetector.GetInstance().GetVideoFormatTypeByVideoId(CurJVideoInfo.uri);
                }
            }
        }
        else
        {
            type = stereoType;
        }

        CurJVideoInfo.stereoType = type;
        LogTool.Log("播放格式:" + (StereoType)type);
        Cinema.VideoPlayer.SetPlayMode((StereoType)type);
        ImaxPurpleControlByStereoType((StereoType)type);
        VideoPlayerPanel.ShowUI();
        WindowStereoTypeUIReset();
    }
 private void OnApplicationQuit()
 {
     VideoFormatDictionaryDetector.GetInstance().SaveVideoFormatTypeDic();
     ImageFormatDictionaryDetector.GetInstance().SaveImageFormatTypeDic();
 }