private void parseCompleted(YTDLPlayer instance, VideoInfo videoInfo) { ytdlPlayer.prepareCompleted += prepareCompleted; bool preparation = ytdlPlayer.Prepare(); Debug.Log("YT preparation " + preparation); }
public void init(string url, MediaSource.MediaPrepared mediaPrepared) { this.mediaPrepared = mediaPrepared; transform.Find("YTDLPlayer_360").gameObject.SetActive(false); transform.Find("YTDLPlayer").gameObject.SetActive(false); playerObject.SetActive(true); string playerStr = "YTDLPlayer"; if (url.EndsWith("360")) { playerStr = "YTDLPlayer_360"; url = url.Substring(0, url.Length - "360".Length); Debug.Log("33333333333333333333360 YOUTUBE VIDEO TEST " + url); } GameObject sink = transform.Find(playerStr).gameObject; ytdlPlayer = sink.GetComponentInChildren <YTDLPlayer>(); ytdlCore = sink.GetComponentInChildren <YTDLCore>(); videoPlayer = ytdlCore.GetComponent <VideoPlayer>(); videoPlayer.started += videoPlayerStarted; //ytdlPlayer.SetVideoUrl(url); ytdlPlayer.url = url; ytdlPlayer.parseCompleted += parseCompleted; ytdlPlayer.Parse(false); }
private void prepareCompleted(YTDLPlayer instance) { Debug.Log("video prepared"); if (mediaPrepared != null) { mediaPrepared(); } }