Skip to content

Add VK Video Live streaming platform support - #393

Open
blackVanilla wants to merge 5 commits into
eerimoq:mainfrom
blackVanilla:feature/vkvideolive
Open

blackVanilla wants to merge 5 commits into
eerimoq:mainfrom
blackVanilla:feature/vkvideolive

Conversation

@blackVanilla

@blackVanilla blackVanilla commented Jul 3, 2026

Copy link
Copy Markdown

Add VK Video Live streaming platform support

This PR adds VK Video Live (a streaming
platform popular in Russia and the CIS) as a platform in Moblin,
alongside Twitch, Kick, YouTube, SOOP and OSP.

Everything is implemented against the official public DevAPI
(https://dev.live.vkvideo.ru/docs/) — REST at apidev.live.vkvideo.ru
and the Centrifugo-based pubsub websocket. No private/reverse
engineered endpoints are used.

What works

  • Login — OAuth2 implicit flow in a web view (the VK ID login form
    opens as a popup, handled via WKUIDelegate). The access token is
    stored in the keychain and stripped from the settings JSON, same as
    for Twitch. Channel URL and nick are auto-filled after login.
  • Chat — real time over the pubsub websocket (Centrifugo v4, JSON
    protocol), with automatic reconnect and token refresh. Messages show
    nick colors (the platform's 16-color palette), badges, roles and
    smiles. Deleted messages are marked as deleted. Reward redemptions
    (channel points) are shown as highlighted messages, like Twitch
    redemptions.
  • Sending messages — including chat bot replies and the
    send-messages-to selector in the chat quick button.
  • Viewers — the viewer count is polled every 30 seconds and shown
    in the stream overlay together with the other platforms.
  • Stream info — show and change stream title and category (with
    category search) from stream settings.
  • Moderation — slow mode and emotes only mode via the chat
    settings endpoint.
  • Chat connection status in the overlay, streamer mentions for TTS,
    new localizable strings.
  • Follower, subscription and raid alerts — delivered on the info
    pubsub channel, shown as toasts and highlighted chat messages with
    Chat/Toasts toggles. Subscription alerts include the subscription
    level name. Chat messages carry the subscriber flag (from the
    subscription badge) for TTS filters and chat bot permissions.

Known API limitations (not bugs)

The DevAPI currently has no endpoints/events for:

  • bans, timeouts and message deletion (the moderation menu says so),
  • reply metadata (replies arrive as plain messages),
  • follower/subscription events and raids,
  • gifted subscriptions are indistinguishable from regular ones (the
    event carries no gifter),
  • rewards with hidden text (never delivered to the public API).

Notes for the maintainer

  • The app identifier (vkVideoLiveMoblinAppClientId in
    VkVideoLiveAuth.swift) currently points to my registered DevAPI
    application. You may want to register an official Moblin application
    in the developer cabinet (https://dev.live.vkvideo.ru) and replace
    it. The redirect URI must be https://localhost. The client id is
    public information (like the Twitch client id), no secret is used.
  • The websocket event type constants are not documented by VK; the
    handled types (channel_chat_message_send,
    channel_chat_message_delete) and the reward message format were
    verified against the live service. Unknown event types are logged at
    debug level and ignored.
  • The platform logo is extracted from the official VK Video Live
    developer portal assets.

Testing

Tested on a real device against a live channel: login, chat receive
(colors/badges/smiles), send, message deletion sync, reward
redemptions, viewer count, title/category changes, slow mode, emotes
only mode, reconnects on network changes, and error paths (expired
token, 4xx/5xx responses, invalid data).

Screenshots

IMG_5290 image IMG_5292

Add live.vkvideo.ru as a chat/streaming platform, implemented against
the official DevAPI (https://dev.live.vkvideo.ru/docs/):
- Login with OAuth2 implicit flow in a web view. The access token is
  stored in the keychain, like for Twitch.
- Real time chat over the platform's Centrifugo based pubsub websocket:
  messages with nick colors, badges and smiles, message deletions, and
  reward redemptions (shown as highlighted messages, like for Twitch).
- Send chat messages, also from the chat bot.
- Number of viewers in the stream overlay (polled every 30 seconds).
- Show and change stream title and category.
- Moderation: slow mode and emotes only mode. The DevAPI has no
  endpoints for bans, timeouts or message deletion, so those are not
  supported.
- Settings UI, chat connection status, send-messages-to selector and
  streamer mentions for text to speech.

The application identifier for the developer cabinet is defined in
VkVideoLiveAuth.swift.
Handle the channel_follow_create and channel_raid_income events from
the info pubsub channel and show them as toasts and highlighted chat
messages, like for Twitch:
- New follower: "<nick> just followed!", also updates the latest
  follower for text widgets.
- Incoming raid: "<nick> raided with a party of <count>!".
Add an Alerts section (Chat and Toasts) to the VK Video Live stream
settings with Follows, Rewards and Raids toggles. Reward redemptions
now respect the toggles as well: the chat highlight can be disabled
(the message is then shown as a regular chat message) and a toast can
be shown.
Nick colors in alerts use the platform's palette, like in chat.
Note: the DevAPI does not notify the raiding channel about outgoing
raids, and there is no endpoint to start a raid, so only incoming
raids are shown.
Handle the channel_subscription_create event from the info pubsub
channel and show it as a toast and a highlighted chat message, like
for Twitch: "<nick> just subscribed (<subscription level name>)!".
Also updates the latest subscriber for text widgets. Controlled by
new Subscriptions toggles in the alerts settings.
Gifted subscriptions are indistinguishable from regular ones — the
event carries no gifter information — so they show the same alert.
Also detect the subscriber status of chat message authors from their
subscription badge, enabling subscribers-only text to speech
filtering and chat bot permissions for VK Video Live.
@blackVanilla
blackVanilla force-pushed the feature/vkvideolive branch from 3f9c3ee to 6c315fa Compare July 9, 2026 20:32
@blackVanilla
blackVanilla marked this pull request as ready for review July 9, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant