예제 #1
0
        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));
            }
        }
예제 #2
0
        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 },
            });
        }