<?php
include_once __DIR__ . "/_common.php";

if (defined('G5_THEME_PATH') && file_exists(G5_THEME_PATH . "/bgm.php")) {
  include_once G5_THEME_PATH . '/bgm.php';
  return;
}

if ($action == "play") {
?>
<!doctype html>
  <html lang="ko">
  <head>
    <meta charset="utf-8">
  </head>
  <body>
    <iframe id="ytplayer" type="text/html" width="640" height="360"
      src="https://www.youtube.com/embed?listType=playlist&list=<?= $config['cf_bgm'] ?>&autoplay=1&disablekb=1&loop=1&playsinline=1&rel=0&origin=<?= G5_URL ?>"
      frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
  </body>
</html>
<?php
}
