Tinychat YouTube Playback Script

Opens a separate window for YouTube video playback on Tinychat.

2023/05/07のページです。最新版はこちら

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
作者
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