/* ]]> */ </script> <script src="<?php echo amt_embed_make_https(amt_embed_get_includes_url('js/mediaelement/mediaelement-and-player.min.js')); ?> "></script> <script src="<?php echo amt_embed_make_https(amt_embed_get_includes_url('js/mediaelement/wp-mediaelement.js')); ?> "></script> <link rel="stylesheet" href="<?php echo amt_embed_make_https(amt_embed_get_includes_url('js/mediaelement/mediaelementplayer.min.css')); ?> " /> <link rel="stylesheet" href="<?php echo amt_embed_make_https(amt_embed_get_includes_url('js/mediaelement/wp-mediaelement.css')); ?> " /> </head> <body marginwidth="0" marginheight="0"> <?php $attrs = array('src' => amt_embed_make_https(amt_embed_get_stream_url(amt_embed_get_id())), 'loop' => '', 'autoplay' => '', 'preload' => 'none'); echo do_shortcode(wp_audio_shortcode($attrs)); ?> </body> </html>
function amt_embed_template_include($default_template) { if (is_amtembed()) { // The container page with the embedded audio/video has been requested. // We only process requests for local video or audio embedded attachments. $embed_type = amt_embed_get_type(amt_embed_get_id()); if ($embed_type === false) { return amt_force_404_template(); } // Construct the template name $embed_template = sprintf('amt-embed-%s-template.php', $embed_type); //var_dump($embed_template); // Return the proper template // First try to locate the template in the theme directory // Here ``get_template_directory()`` is not used to retrieve the theme's directory // because in case of child themes, it returns the directory of the parent theme. // Instead we use ``get_stylesheet_directory()``. // See info: // - http://codex.wordpress.org/Function_Reference/get_template_directory // - http://codex.wordpress.org/Function_Reference/get_stylesheet_directory $template_in_theme_dir = get_stylesheet_directory() . '/' . $embed_template; //var_dump($template_in_theme_dir); $template_in_plugin_dir = AMT_PLUGIN_DIR . 'templates/' . $embed_template; //var_dump($template_in_plugin_dir); if (file_exists($template_in_theme_dir)) { return $template_in_theme_dir; } else { return $template_in_plugin_dir; } // In any other case of embed request, just return a 404 error. return amt_force_404_template(); } // If this is not an embed, just return the default template. return $default_template; }