/// <summary> /// Major role is set data source /// </summary> /// <param name="svrVideoInfo">BaseVideoInfo data</param> public void PreparedPlayVideo(JVideoDescriptionInfo svrVideoInfo) { #if UNITY_ANDROID if (VideoPlayerPtr == IntPtr.Zero) { Debug.Log("VideoPlayerPtr:为IntPtr.Zero"); return; } MediaStretchPlayerPrefsDetector.GetInstance().SetMediaId(svrVideoInfo.id.ToString()); string json = JsonUtility.ToJson(svrVideoInfo); Debug.Log("svrVideoInfo json:" + json); IsVideoReady = false; VideoPlayerPtr = SetDataSource(VideoPlayerPtr, json); IsNeedFreeTexeture = true; IssuePlayerEvent(VideoPlayerEventBase, RenderCommand.InitializePlayer); //shemi:: 之后需要更换为扫描本地字幕,扫描回调中再设置字幕 //string path = svrVideoInfo.uri; //path = MediaManage.GetPath((int)MediaType.Video ,path); //path = path.Substring(0, path.LastIndexOf(".")); //SetSubtitleSource(VideoPlayerPtr, string.Format("{0}.srt", path)); VideoWidth = svrVideoInfo.width; VideoHeight = svrVideoInfo.height; Debug.Log("VideoScreenWidth:" + VideoWidth + " VideoScreenHeight:" + VideoHeight); LogTool.Log("SetDataSource success"); #endif }
void TensileBtnSelectControl() { //if (GlobalVariable.GetSceneModel() == SceneModel.IMAXTheater) //{ // TensileBtn.SetSelected(false); // return; //} TensileBtn.SetSelected(MediaStretchPlayerPrefsDetector.GetInstance().GetMediaStretchKey()); }
/// <summary> /// 画面拉伸与拉伸按钮控制 /// </summary> public void TensileSetStretchingPicture(bool isStretch) { if (isStretch) { SetStretchingPicture(MediaStretchPlayerPrefsDetector.GetInstance().GetMediaStretchKey()); if (TensileBtnStatusControlCallback != null) { TensileBtnStatusControlCallback(m_StereoType); } } }
public void PreparedPlayVideo(Dictionary <string, string> dic) { if (mPlayer == null) { mPlayer = new MifengPlayer(); } MediaStretchPlayerPrefsDetector.GetInstance().SetMediaId(string.Format("{0}-{1}", dic["vid"], dic["cid"])); mPlayer.setDataSource(dic["vid"], dic["cid"]); IsNeedFreeTexeture = true; LogTool.Log("播放索引:" + dic["cid"] + "-" + dic["vid"] + " 播放名称:" + dic["name"] + " 播放类型:" + dic["stereoType"]); VideoWidth = 0; VideoHeight = 0; LogTool.Log("SetDataSource success"); }
void BackLocalMediaPanel() { Cinema.GvrHead.trackPosition = true; isEnterAdFirst = false; Cinema.VideoPlayer.Stop(); //Cinema.VideoPlayer.Release(); PlayerDataControl.GetInstance().ClearVideoDscpInfo(); CinemaTipsCanvasControl.GetInstance().GlobalToast.Hide(); //CinemaGlobalToastCanvasControl.GetInstance().GlobalToast.Hide(); //OnBufferFinishHideLoading(); MediaStretchPlayerPrefsDetector.GetInstance().ResetMediaId(); //GlobalRunningFunction.Instance.Subtitle.transform.parent = GameObject.FindGameObjectWithTag("MainCamera").transform.parent; //GlobalRunningFunction.Instance.ShowControllerRayLine(); //Cinema.ResetSphereScreenDir(); //reset 360 model's dir Cinema.VideoPlayer.ClearVideoCache(); if (PlayerDataControl.GetInstance().StopPlayCallBack != null) { PlayerDataControl.GetInstance().StopPlayCallBack(); } }
void StretchingPicture(bool isOpen) { MediaStretchPlayerPrefsDetector.GetInstance().SetMediaStretchKey(isOpen); Cinema.VideoPlayer.SetStretchingPicture(isOpen); }
void OnVieoSizeEvent(int w, int h) { VideoWidth = w; VideoHeight = h; SetStretchingPicture(MediaStretchPlayerPrefsDetector.GetInstance().GetMediaStretchKey()); }