public static void DACPlaying(DACPlayInfo playInfo, PPTVData.Entity.ChannelDetailInfo channelInfo,Version clientVersion) { string content = "Action=0&A=" + playInfo.castType.ToString() + "&B=1&C=6&D=" + GetUserId() + "&E="; content += (clientVersion==null?"":clientVersion.ToString()); content += "&F=" + channelInfo.TypeID.ToString(); content += "&G=" + channelInfo.VID.ToString(); content += "&H=" + channelInfo.Title; content += "&I=" + playInfo.playTime.ToString("0"); content += "&J=" + playInfo.mp4Name; content += "&K=" + playInfo.programSource.ToString(); content += "&L=" + playInfo.prepareTime.ToString("0"); content += "&M=" + playInfo.bufferTime.ToString("0"); content += "&N=" + playInfo.allBufferCount.ToString(); content += "&O=" + playInfo.dragCount.ToString(); content += "&P=" + playInfo.dragBufferTime.ToString("0"); content += "&Q=" + playInfo.playBufferCount.ToString(); content += "&R=" + playInfo.connType.ToString(); content += "&S=" + playInfo.isPlaySucceeded.ToString(); content += "&T="; content += "&U="; content += "&V=" + playInfo.averageDownSpeed.ToString(); content += "&W=" + playInfo.stopReason.ToString(); content += "&Y1=0"; content += "&Y2=" + DeviceExtendedProperties.GetValue("DeviceName").ToString(); content += "&Y3=" + System.Environment.OSVersion.Version.ToString(); _instance = new DACFactory(); _instance.DACSend(content); }
private void JumpWebClientDownloadStringCompleted(object sender, PPTVData.DownloadStringCompletedEventArgs e) { string mediaServerHost = String.Empty; string serverTime = String.Empty; DateTime serverBaseTime; DateTime localBaseTime; if (e.Error == null) { try { using (System.Xml.XmlReader reader = System.Xml.XmlReader.Create(new System.IO.StringReader(e.Result))) { if (true == reader.ReadToFollowing("server_host")) { mediaServerHost = reader.ReadElementContentAsString("server_host", ""); } else { } reader.ReadToFollowing("server_time"); serverTime = reader.ReadElementContentAsString("server_time", ""); System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("en-US"); serverBaseTime = DateTime.ParseExact(serverTime, "ddd MMM dd HH:mm:ss yyyy UTC", ci); localBaseTime = DateTime.Now; string downUrl = String.Format("http://{0}/{1}?type=wp7&w=1&key={2}", mediaServerHost, _rid, PPTVData.KeyGenerator.GetKey(serverBaseTime)); UpdateTask(_vid, downUrl); } } catch { } } }
private void JumpWebClientDownloadStringCompleted(object sender, PPTVData.DownloadStringCompletedEventArgs e) { string mediaServerHost = String.Empty; string serverTime = String.Empty; DateTime serverBaseTime; DateTime localBaseTime; if (e.Error == null) { try { using (XmlReader reader = XmlReader.Create(new System.IO.StringReader(e.Result))) { if (true == reader.ReadToFollowing("server_host")) { mediaServerHost = reader.ReadElementContentAsString("server_host", ""); } reader.ReadToFollowing("server_time"); serverTime = reader.ReadElementContentAsString("server_time", ""); System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("en-US"); serverBaseTime = DateTime.ParseExact(serverTime, "ddd MMM dd HH:mm:ss yyyy UTC", ci); localBaseTime = DateTime.Now; _downUrl = String.Format("http://{0}/{1}?type=wp7&w=1&key={2}", mediaServerHost, _rid, PPTVData.KeyGenerator.GetKey(serverBaseTime)); if (DetailPageHelp.ChannelDetailInfoForPrograms.ProgramInfos == null || DetailPageHelp.ChannelDetailInfoForPrograms.ProgramInfos.Count() <= 1) DownPage.UpdateTask(DetailPageHelp.ChannelDetailInfoForPrograms.VID.ToString() + "||", _downUrl); else { DownPage.UpdateTask(DetailPageHelp.ChannelDetailInfoForPrograms.VID + "|" + _piForDownload.Index + "|" + _piForDownload.ChannelVID, _downUrl); } if (_downSign != null) { _downSign.Foreground = App.Current.Resources["Orange"] as SolidColorBrush; ; //_downSign.Visibility = Visibility.Visible; if (_piForDownload != null) _piForDownload.IsDown = Visibility.Visible; Utils.CustomAnimation.DownloadAnimation(xDownAnima); } } } catch (Exception) { } } }
void webClient_OpenReadCompleted(object sender, PPTVData.OpenReadCompletedEventArgs e) { try { MediaHistoryItem mediaHistoryItem1 = new MediaHistoryItem(); mediaHistoryItem1.ImageStream = e.Result; mediaHistoryItem1.Title = _channelDetailInfo.Title; mediaHistoryItem1.PlayerContext.Add("HubTag", _channelDetailInfo.VID + "|||" + ProgramIndex); MediaHistory.Instance.WriteAcquiredItem(mediaHistoryItem1); e.Result.Position = 0; MediaHistory.Instance.WriteRecentPlay(mediaHistoryItem1); } catch { } }