public void SendRoomPlaylist() { var room = Socket.GetInfo().GetRoom(); if (room == null) { return; } foreach (var videoInfo in room.Playlist) { SendAddVideo(videoInfo, YoutubeHelper.GetTitle(videoInfo.VideoID), YoutubeHelper.GetDuration(videoInfo.VideoID).ToString(), YoutubeHelper.GetAuthor(videoInfo.VideoID), YoutubeHelper.GetChannelImage(videoInfo.VideoID)); } }
public void SendSetVideo(VideoInfo videoInfo, PlayState state, double elapsed = 0) { var info = Socket.GetInfo(); string videoName = YoutubeHelper.GetTitle(videoInfo.VideoID); TimeSpan videoDuration = YoutubeHelper.GetDuration(videoInfo.VideoID); var title = YoutubeHelper.GetTitle(videoInfo.VideoID); var description = YoutubeHelper.GetDescription(videoInfo.VideoID); Helper.SendQuick(Socket, new Dictionary <string, object> { { "intent", "setVideo" }, { "uniqueId", videoInfo.ID }, { "videoId", videoInfo.VideoID }, { "videoName", videoName }, { "title", title }, { "description", description }, { "duration", (int)videoDuration.TotalSeconds }, { "elapsed", elapsed }, { "state", (int)state }, }); }