A client library for YouTube Data / Live Streaming API v3 to get live chat messages for Unity.
- Videos API to get live chat ID by video ID.
- Live streaming messages API by live chat ID.
- Live streaming messages collection as UniRx event.
Add following dependencies to your /Packages/manifest.json
.
{
"dependencies": {
"com.mochineko.youtube-live-streaming-client": "https://github.com/mochi-neko/youtube-live-streaming-client-unity.git?path=/Assets/Mochineko/YouTubeLiveStreamingClient#0.2.5",
"com.mochineko.relent": "https://github.com/mochi-neko/Relent.git?path=/Assets/Mochineko/Relent#0.2.0",
"com.mochineko.relent.extensions.newtonsoft-json": "https://github.com/mochi-neko/Relent.git?path=/Assets/Mochineko/Relent.Extensions/NewtonsofJson#0.2.0",
"com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask",
"com.neuecc.unirx": "https://github.com/neuecc/UniRx.git?path=Assets/Plugins/UniRx/Scripts"
...
}
}
Standard workflow is as follows.
- Publish your API key of YouTube Data API v3.
- Get live chat ID from videos API with API key and video ID.
- Get live chat messages from live streaming messages API with API key and live chat ID.
You can select from 2 ways to do above workflow.
- Directly use
VideosAPI
andLiveChatMessagesAPI
.- See test code.
- Use
LiveChatMessagesCollector
that pollsLiveChatMessagesAPI
and provides messages as UniRx event.- See sample code.
See CHANGELOG.
See NOTICE.
Licensed under the MIT license.