Tinychat YouTube Playback Script

Opens a separate window for YouTube video playback on Tinychat.

2023-05-07 기준 버전입니다. 최신 버전을 확인하세요.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

작성자
meth0dz
평점
0 0 0
버전
1.33
생성일
2023-05-07
갱신일
2023-05-07
크기
4.71KB
라이선스
CC0-1.0
적용 사이트

This userscript enables users to play YouTube videos in a separate window while on Tinychat. The script is compatible with webpages that match the URL pattern https://tinychat.com/room/*. Key features of the script include the creation of a search bar for YouTube videos, a video button to play the selected video, and integration with the YouTube API for search functionality.

The script starts by defining a regular expression for matching YouTube URLs and a function to fetch the YouTube API key securely.
It then defines a function openVideoWindow to open a separate window for video playback, setting parameters such as window size and autoplay.
Custom CSS styles are added for the video button using GM_addStyle. A menu command is created to clear the stored video URL using GM_registerMenuCommand.

The script checks for a stored video URL and displays the video button if found. The createSearchBar function is defined to create the YouTube search bar, including: Creating a search input field and datalist element for search suggestions. Adding an event listener to fetch search results using the YouTube API when the input is updated. Creating a search button to play the selected video and store its URL. Adding the search bar to the document body. Finally, the search bar is created by invoking the createSearchBar function.

This userscript enhances the Tinychat experience by allowing users to conveniently search and play YouTube videos without leaving the Tinychat platform.


Edit the 'ADD_YOUR_API_KEY' with your own key on line 26

Get your API Key here: https://console.cloud.google.com


Step 1. Create New Project

Step 2. Go To Credentials Screen

Step 3. Click Create Credentials

Step 4. Click Enabled APIs

Step 5. Search & Choose YouTube V3 API

Step 6. Go to Credentials, Edit API Key, API Restrictions, Choose YouTube V3 API