. /** * Manager for media files * * @package core_media * @copyright 2016 Marina Glancy * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); /** * Manager for media files. * * Used in file resources, media filter, and any other places that need to * output embedded media. * * Usage: * $manager = core_media_manager::instance(); * * * @package core_media * @copyright 2016 Marina Glancy * @author 2011 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ final class core_media_manager { /** * Option: Disable text link fallback. * * Use this option if you are going to print a visible link anyway so it is * pointless to have one as fallback. * * To enable, set value to true. */ const OPTION_NO_LINK = 'nolink'; /** * Option: When embedding, if there is no matching embed, do not use the * default link fallback player; instead return blank. * * This is different from OPTION_NO_LINK because this option still uses the * fallback link if there is some kind of embedding. Use this option if you * are going to check if the return value is blank and handle it specially. * * To enable, set value to true. */ const OPTION_FALLBACK_TO_BLANK = 'embedorblank'; /** * Option: Enable players which are only suitable for use when we trust the * user who embedded the content. * * At present, this option enables the SWF player. * * To enable, set value to true. */ const OPTION_TRUSTED = 'trusted'; /** * Option: Put a div around the output (if not blank) so that it displays * as a block using the 'resourcecontent' CSS class. * * To enable, set value to true. */ const OPTION_BLOCK = 'block'; /** * Option: When the request for media players came from a text filter this option will contain the * original HTML snippet, usually one of the tags: or