Implement a Kodi client
Using JSON-RPC via a websocket + https://github.com/firsttris/plugin.video.sendtokodi (see examples)
Chat (one-way): https://kodi.wiki/view/JSON-RPC_API/v12#GUI.ShowNotification
Playback: https://kodi.wiki/view/JSON-RPC_API/v12#Player.Open https://kodi.wiki/view/JSON-RPC_API/v12#Player.Seek https://kodi.wiki/view/JSON-RPC_API/v12#Player.PlayPause https://kodi.wiki/view/JSON-RPC_API/v12#Player.Stop
Playlist (optional): https://kodi.wiki/view/JSON-RPC_API/v12#Playlist.Add https://kodi.wiki/view/JSON-RPC_API/v12#Playlist.Insert https://kodi.wiki/view/JSON-RPC_API/v12#Playlist.Remove https://kodi.wiki/view/JSON-RPC_API/v12#Playlist.Clear https://kodi.wiki/view/JSON-RPC_API/v12#Player.GoTo
Set up notifications (for player events): https://kodi.wiki/view/JSON-RPC_API/v12#JSONRPC.SetConfiguration https://kodi.wiki/view/JSON-RPC_API/v12#Notifications_2 https://kodi.wiki/view/JSON-RPC_API/v12#Player_3 https://kodi.wiki/view/JSON-RPC_API/v12#Input_3