Skip to content

PRO - requires MediaShield Pro and a Bunny Stream connection.

A webhook lets Bunny Stream tell your site when a video has finished encoding (or failed). MediaShield then fills in the real video length, refreshes the thumbnail and records the encoding status. Without it, a freshly uploaded Bunny video keeps a length of zero until you set it by hand.

New Bunny uploads get their real length and a fresh thumbnail on their own. Completion percentages and mid-roll ad breaks need the length, so without it a new video is awkward to measure.

  • Connect Bunny Stream.
  • Your site must be reachable from the internet. A local .test or .local site cannot receive Bunny’s call.
  1. Go to MediaShield > Platforms.
  2. In Connect a Platform, choose Bunny Stream. The form shows a Webhook URL. It ends with ms_token= and a long secret.
  3. Copy the whole address.
  4. In the Bunny dashboard, open your Stream library and find Webhook.
  5. Paste the address and save.

The secret in the address is created for you the first time it is needed. Treat the address like a password.

Bunny status What MediaShield does
Finished (3) or Resolution finished (4) Reads the video’s length from Bunny and saves it, marks the video’s encoding status as finished, refreshes the thumbnail from Bunny
Failed (5) Marks the video’s encoding status as error. With WP_DEBUG on, writes a line to the PHP log
Anything else (queued, processing, encoding, captions, title generated) Nothing. The call is answered and ignored

Bunny’s call carries only the library, the video ID and the status, so MediaShield asks Bunny for the length with the saved API key.

The video is found by its Bunny video ID. A call for a video that is not in your library is ignored, unless you switch on Add new Bunny uploads to MediaShield automatically (below).

Off by default. On the connected Bunny card under MediaShield > Platforms, switch on Add new Bunny uploads to MediaShield automatically. From then on, when Bunny reports a new upload that MediaShield does not have yet, it is added the same way Browse & Import adds it (title, your default protection, then the length and thumbnail once Bunny reports them), but as a draft. Nothing plays on your site until you publish it.

  • Only uploads from the last 24 hours in the connected library are added, each one once, however often Bunny calls.
  • A video you moved to the trash is never added back. Restore it from the trash, or delete it for good and use Browse & Import.
  • A call that fails the security check below adds nothing.

Drafts do not show in MediaShield > Videos. Until you publish them, the connected Bunny card under MediaShield > Platforms and a notice on the WordPress Dashboard name each new draft and link to it. Videos uploaded before you switched this on still need Browse & Import.

The address is public by necessity, because Bunny does not log in. Each call must prove it came from Bunny in one of two ways: the secret ms_token in the webhook URL that MediaShield shows you, or Bunny’s own X-BunnyStream-Signature header. The signature can only be checked once the library’s Read-Only API key is saved (Bunny: Stream > your library > API). Add it while connecting, or later on the connected Bunny card under MediaShield > Platforms: paste it into Read-Only API Key and click Save key. The card shows whether a key is saved, and lets you replace or remove it without reconnecting. Calls with neither are refused with a 403 and do nothing. This stops strangers from changing a video’s length or forcing thumbnail downloads.

Viewers see nothing. Their lesson simply shows the right length and thumbnail.

Name Default What it does
Webhook URL Generated Shown on the Platforms page. Read only
Add new Bunny uploads to MediaShield automatically (ms_bunny_auto_import) Off Adds each new upload in the connected library as a draft MediaShield video when Bunny’s webhook calls
ms_bunny_webhook_key Generated on first use The secret. Kept after Pro is deleted. Delete the option to make a new one, then paste the new address into Bunny

If the length stays at zero, see Troubleshooting. Developers can react to the events with mediashield_bunny_encoded and mediashield_bunny_failed. See Hooks and Filters.