Tinychat YouTube Playback Script

Opens a separate window for YouTube video playback on Tinychat.

当前为 2023-05-07 提交的版本,查看 最新版本

作者
meth0dz
评分
0 0 0
版本
1.2
创建于
2023-05-07
更新于
2023-05-07
大小
4.7 KB
许可证
CC0-1.0
适用于

This script allows users to play YouTube videos in a separate window while using Tinychat. Here's a simpler description of the code:

1. It defines a pattern for YouTube URLs and a function to get the YouTube API key.

2. The API key is fetched and stored.

3. A function to open a separate window for video playback is defined.

4. CSS styles are added for a video button.

5. A menu command is created to clear the stored video URL.

6. The script checks for a stored video URL and displays a video button if found.

7. A function is defined to create a YouTube search bar, which includes:
• A search input field and a datalist element for search suggestions.
• An event listener to get search results using the YouTube API when the input is updated.
• A search button to play the selected video and store its URL.

8. The search bar is created by calling the function.


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

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址