import React from "react";
import { Player } from "./player.js";
import { DailyMotion } from "./players/dailymotion.js";
import { SoundCloud } from "./players/soundcloud.js";
import { Vimeo } from "./players/vimeo.js";
import { YouTube } from "./players/youtube.js";
const PRELOAD_PLAYERS = [
  {
    Player: YouTube,
    configKey: "youtube",
    url: "https://www.youtube.com/watch?v=GlCmAC4MHek"
  },
  {
    Player: SoundCloud,
    configKey: "soundcloud",
    url: "https://soundcloud.com/seucheu/john-cage-433-8-bit-version"
  },
  {
    Player: Vimeo,
    configKey: "vimeo",
    url: "https://vimeo.com/300970506"
  },
  {
    Player: DailyMotion,
    configKey: "dailymotion",
    url: "http://www.dailymotion.com/video/xqdpyk"
  }
];
function renderPreloadPlayers(url, controls, config) {
  const players = [];
  for (const player of PRELOAD_PLAYERS) {
    if (!player.Player.canPlay(url) && config[player.configKey].preload) {
      players.push(
        /* @__PURE__ */ React.createElement(
          Player,
          {
            key: player.Player.displayName,
            activePlayer: player.Player,
            url: player.url,
            controls,
            playing: true,
            muted: true,
            display: "none"
          }
        )
      );
    }
  }
  return players;
}
export {
  renderPreloadPlayers
};
//# sourceMappingURL=preload.js.map
