forked from njaber/moodle-mod_mplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathembed.php
More file actions
59 lines (49 loc) · 1.83 KB
/
Copy pathembed.php
File metadata and controls
59 lines (49 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This page prints a particular instance of mplayer without any standard Moodle navigation
* It's useful for embedding video in Moodle web pages
*
* @package mod_mplayer
* @category mod
* @author Matt Bury - matbury@gmail.com
* @author Valery Fremaux <valery.fremaux@gmail.com>
* @licence http://www.gnu.org/copyleft/gpl.html GNU Public Licence
*/
require('../../config.php');
require_once($CFG->dirroot.'/mod/mplayer/lib.php');
list($cm, $course, $mplayer) = mplayer_get_context();
// Security.
require_login($course->id);
$context = context_module::instance($cm->id);
require_capability('mod/mplayer:view', $context);
$event = \mod_mplayer\event\mplayer_viewed::create(array(
'objectid' => $cm->id,
'context' => $context,
'other' => array(
'objectname' => $mplayer->name
)
));
$event->add_record_snapshot('mplayer', $mplayer);
$event->trigger();
// Add instance ID to mplayer object.
$mplayer->instance = $id;
/*
* Don't print a Moodle header since this page will be included in another Moodle page as an iframe
* Print the Media Player Flash embed code
*/
echo mplayer_print_body($mplayer);
// Don't print any footers here.