Exemplo n.º 1
0
    protected override void onClick(string name)
    {
        if ("cancelBtn" == name)
        {
            //GameEventMgr.GetInstance().DispatchEvent("CloseUI", EventType.UIMsg, "UILogin");
        }

        if (name == "okBtn")
        {
            Debug.LogWarning("点击了OK按钮!");
            //TODO: 测试视频下载
            var path = Path.Combine(AppConst.AssetPath, "Videos.mp4");
            //var testUrl = @"http://vjs.zencdn.net/v/oceans.mp4";
            var testUrl = @"http://vjs.zencdn.net/v/oceans.mp4" + "?" + DateTime.Now;
            Debug.LogWarning("-------------->视频网络资源地址" + testUrl);
            DownloadMovHelper.Begin(path, testUrl, () =>
            {
                Debug.LogWarning("开始下载。");
            }
                                    ,
                                    () =>
            {
                Debug.LogWarning("下载完成。");
            },
                                    (reason) =>
            {
                Debug.LogWarning("下载失败原因" + reason);
            },
                                    (progress) =>
            {
                Debug.LogWarning("下载进度" + progress);
            });
        }
        if (name == "bg")
        {
            Debug.LogWarning("点击了bg按钮");
        }
        if (name == "calcelBtn")
        {
            DownloadMovHelper.Stop();
        }
    }