示例#1
0
        /// <summary>
        /// Create a room using the information provided by the user.
        /// </summary>
        /// <param name="title">The title of the room</param>
        /// <param name="rawMediaUrl">The URL of the YouTube video</param>
        /// <returns></returns>
        public async Task CreateRoom(string title, string rawMediaUrl, string passkey)
        {
            Room sendingRoom = new Room();

            sendingRoom.Title   = title;
            sendingRoom.Passkey = passkey;

            // Extracts the video ID from the YouTube URL that was provided by the user
            sendingRoom.CurrentMedia = new Media(YouTubeNavigation.YouTubeIDFromRawUrl(rawMediaUrl));

            // Set the RoomManager's room to that was created on the server
            Room = await restService.PutRoomData(sendingRoom);
        }
示例#2
0
        /// <summary>
        /// Sets the current media of the room to that provided from a YouTube site URL.
        /// </summary>
        /// <param name="rawUrl"></param>
        public void SetRoomMedia(string rawUrl)
        {
            string videoId = YouTubeNavigation.YouTubeIDFromRawUrl(rawUrl);

            webSocketService.ChangeMedia(videoId);
        }