<?php
/**
 * Plugin Name: SceneSat Video Embeds
 * Description: Embed SceneSat stream links with responsive sizing and player permissions.
 * Version: 1.0.0
 */

// Install in wp-content/mu-plugins/scenesat-embeds.php (or activate as a plugin).
if (!defined('ABSPATH')) {
    exit;
}

add_action('init', static function (): void {
    $endpoint = 'https://control.scenesat.com/api/oembed';
    wp_oembed_add_provider(
        '#^https?://(?:control|watch)\.scenesat\.com/(?:embed(?:flow)?(?:\.html)?|embed-chat\.html|player(?:\.html)?)/?\?.+$#i',
        $endpoint,
        true
    );
    wp_oembed_add_provider(
        '#^https?://watch\.scenesat\.com/[A-Za-z0-9_-]+/?(?:\?.*)?$#i',
        $endpoint,
        true
    );
});
