lib.php 21.6 KB
Newer Older
Penny Leach's avatar
Penny Leach committed
1
2
3
4
5
<?php
/**
 *
 * @package    mahara
 * @subpackage blocktype-internalmedia
6
 * @author     Catalyst IT Ltd
7
8
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
Penny Leach's avatar
Penny Leach committed
9
10
11
12
13
 *
 */

defined('INTERNAL') || die();

14
class PluginBlocktypeInternalmedia extends MaharaCoreBlocktype {
Penny Leach's avatar
Penny Leach committed
15

16
17
18
19
20
21
22
23
24
    /**
     * @DEPRECATED: Default width & height. Not currently used, because we
     * use CSS to make all videos scale to fill the width of their container
     * while maintaining their aspect ratio. Kept here so we don't have to
     * tear out all the width/height display code.
     */
    const DEFAULT_WIDTH = 900;
    const DEFAULT_HEIGHT = 600;

Penny Leach's avatar
Penny Leach committed
25
26
27
28
    public static function get_title() {
        return get_string('title', 'blocktype.file/internalmedia');
    }

Lisa Seeto's avatar
Lisa Seeto committed
29
30
31
32
    public static function single_artefact_per_block() {
        return true;
    }

Penny Leach's avatar
Penny Leach committed
33
34
35
36
37
    public static function get_description() {
        return get_string('description', 'blocktype.file/internalmedia');
    }

    public static function get_categories() {
38
        return array('fileimagevideo' => 7000);
Penny Leach's avatar
Penny Leach committed
39
40
41
42
43
44
45
46
    }

    public static function has_config() {
        return true;
    }

    public static function postinst($oldversion) {
        if ($oldversion == 0) {
47
            set_config_plugin('blocktype', 'internalmedia', 'enabledtypes', serialize(array('flv', 'mp3', 'mp4')));
Penny Leach's avatar
Penny Leach committed
48
49
50
        }
    }

51
    public static function render_instance(BlockInstance $instance, $editing=false, $versioning=false) {
52
53
        list($artefact, $width, $height) = self::get_mediaplayer_details($instance);
        if (!$artefact) {
Penny Leach's avatar
Penny Leach committed
54
55
            return '';
        }
56
57
58

        $playerclass = self::get_player_class_for_artefact($artefact);
        if (!$playerclass) {
59
            return get_string('typeremoved', 'blocktype.file/internalmedia');
Penny Leach's avatar
Penny Leach committed
60
        }
Lisa Seeto's avatar
Lisa Seeto committed
61
62
63
        $smarty = smarty_core();
        $smarty->assign('artefactid', $artefact->get('id'));
        $smarty->assign('blockid', $instance->get('id'));
64
65
66
67

        require_once(get_config('docroot') . 'artefact/comment/lib.php');
        require_once(get_config('docroot') . 'lib/view.php');
        $view = new View($instance->get('view'));
Lisa Seeto's avatar
Lisa Seeto committed
68
69
70
71
        $smarty->assign('allowcomments', $artefact->get('allowcomments'));
        if (!$artefact->get('allowcomments')) {
            $smarty->assign('justdetails', true);
        }
72
        list($commentcount, $comments) = ArtefactTypeComment::get_artefact_comments_for_view($artefact, $view, $instance->get('id'), true, $editing, $versioning);
73
74
        $smarty->assign('commentcount', $commentcount);
        $smarty->assign('comments', $comments);
Lisa Seeto's avatar
Lisa Seeto committed
75
        $result = '<div class="mediaplayer-container card-body flush"><div class="mediaplayer">';
Lisa Seeto's avatar
Lisa Seeto committed
76
77
78
        $result .= call_static_method($playerclass, 'get_html', $artefact, $instance, $width, $height);
        $result .= '</div></div>';

79
80
        $smarty->assign('html', $result);
        return $smarty->fetch('blocktype:internalmedia:internalmedia.tpl');
Penny Leach's avatar
Penny Leach committed
81
82
    }

83
    public static function has_instance_config(BlockInstance $instance) {
Penny Leach's avatar
Penny Leach committed
84
85
86
        return true;
    }

Son Nguyen's avatar
Son Nguyen committed
87
    public static function instance_config_form(BlockInstance $instance) {
Penny Leach's avatar
Penny Leach committed
88
        $configdata = $instance->get('configdata');
89
90
        safe_require('artefact', 'file');
        $instance->set('artefactplugin', 'file');
91
        $filebrowser = self::filebrowser_element($instance, (isset($configdata['artefactid'])) ? array($configdata['artefactid']) : null);
92
        return array(
93
94
95
96
97
            'artefactfieldset' => array(
                'type'         => 'fieldset',
                'collapsible'  => true,
                'collapsed'    => true,
                'legend'       => get_string('media', 'blocktype.file/internalmedia'),
98
                'class'        => 'last select-file with-formgroup',
99
100
101
102
                'elements'     => array(
                    'artefactid' => $filebrowser
                )
            ),
Penny Leach's avatar
Penny Leach committed
103
        );
104
105
    }

106
107
    public static function filebrowser_element(&$instance, $default=array()) {
        $element = ArtefactTypeFileBase::blockconfig_filebrowser_element($instance, $default);
108
        $element['title'] = get_string('media', 'blocktype.file/internalmedia');
109
        $element['name'] = 'artefactid';
110
        $element['config']['selectone'] = true;
111
        $element['config']['selectmodal'] = true;
112
        $element['filters'] = array(
113
            'artefacttype'    => array('file', 'audio', 'video'),
114
            'filetype'        => self::get_allowed_mimetypes(),
115
        );
116
        $element['accept'] = implode(',', self::get_allowed_mimetypes());
117
118
119
        return $element;
    }

120
    public static function artefactchooser_element($default=null) {
Penny Leach's avatar
Penny Leach committed
121
122
123
124
125
126
127
128
        return array(
            'name' => 'artefactid',
            'type'  => 'artefactchooser',
            'title' => get_string('media', 'blocktype.file/internalmedia'),
            'defaultvalue' => $default,
            'blocktype' => 'internalmedia',
            'limit' => 5,
            'selectone' => true,
129
            'artefacttypes' => array('file', 'audio', 'video'),
Penny Leach's avatar
Penny Leach committed
130
131
132
133
            'template' => 'artefact:file:artefactchooser-element.tpl',
        );
    }

134
135
136
137
138
    public static function artefactchooser_get_element_data($artefact) {
        $artefact->icon = call_static_method(generate_artefact_class_name($artefact->artefacttype), 'get_icon', array('id' => $artefact->id));
        return $artefact;
    }

Son Nguyen's avatar
Son Nguyen committed
139
    public static function save_config_options(Pieform $form, $values) {
Penny Leach's avatar
Penny Leach committed
140
141
        $enabledtypes = array();
        foreach ($values as $type => $enabled) {
142
            if (!in_array($type, self::get_all_filetypes())) {
143
144
                continue;
            }
Penny Leach's avatar
Penny Leach committed
145
146
147
148
149
150
151
152
153
154
155
            if (!empty($enabled)) {
                $enabledtypes[] = $type;
            }
        }
        set_config_plugin('blocktype', 'internalmedia', 'enabledtypes', serialize($enabledtypes));
    }

    public static function get_config_options() {
        $elements = array();
        // Allowed file types
        $filetypes = array();
156
        $currenttypes = self::get_allowed_filetypes();
Penny Leach's avatar
Penny Leach committed
157

158
        foreach (self::get_all_filetypes() as $filetype) {
159
            $filetypes[$filetype] = array(
160
                'type'  => 'switchbox',
161
162
163
                'title' => get_string($filetype, 'artefact.file'),
                'defaultvalue' => in_array($filetype, $currenttypes),
            );
Penny Leach's avatar
Penny Leach committed
164
        }
165
        uasort($filetypes, function($a, $b) { return $a["title"] > $b["title"]; });
166
        $options = array_merge(
Penny Leach's avatar
Penny Leach committed
167
168
            array(
                'description' => array(
169
                    'value' => get_string('configdesc1', 'blocktype.file/internalmedia'),
Penny Leach's avatar
Penny Leach committed
170
171
172
173
174
175
                ),
            ),
            $filetypes
        );

        return array(
176
            'elements' => $options,
Penny Leach's avatar
Penny Leach committed
177
178
179
        );
    }

180
181

    private static function get_allowed_filetypes() {
Penny Leach's avatar
Penny Leach committed
182
183
184
185
186
187
        if ($data = get_config_plugin('blocktype', 'internalmedia', 'enabledtypes')) {
            return unserialize($data);
        }
        return array();
    }

188
189
190
191
192
193
194
195
196
197
198
199
200
201
202

    private static function get_allowed_mimetypes() {
        return array_keys(self::get_allowed_mimetype_filetypes());
    }


    private static function get_allowed_mimetype_filetypes() {
        if ($data = self::get_allowed_filetypes()) {
            if ($mimetypes = get_records_sql_assoc('
                SELECT mimetype, description
                FROM {artefact_file_mime_types}
                WHERE description IN (' . join(',', array_map('db_quote', $data)) . ')', array())) {
                foreach ($mimetypes as &$m) {
                    $m = $m->description;
                }
203
204
205
206
207
208
209
210
                // Hack to allow .wmv and .wma files to also use the .asf mimetype as well
                // See http://en.wikipedia.org/wiki/Advanced_Systems_Format
                if (in_array('wmv', $data)) {
                    $mimetypes['video/x-ms-asf'] = 'wmv';
                }
                if (in_array('wma', $data)) {
                    $mimetypes['video/x-ms-asf'] = 'wma';
                }
211
212
213
214
215
216
217
                return $mimetypes;
            }
        }
        return array();
    }


218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
    /**
     * Get the MaharaMediaPlayer class appropriate for this artefact.
     * Or boolean false if there is none.
     *
     * @param ArtefactType $artefact
     * @return string|false
     */
    private static function get_player_class_for_artefact($artefact) {
        $mimetype = $artefact->get('filetype');
        $mimetypefiletypes = self::get_allowed_mimetype_filetypes();
        if (!isset($mimetypefiletypes[$mimetype])) {
            return false;
        }
        else {
            $callbacks = self::get_all_filetype_players();
            $classname = 'MaharaMediaPlayer_' . $callbacks[$mimetypefiletypes[$mimetype]];
            if (class_exists($classname)) {
                return $classname;
            }
            else {
                return false;
            }
        }
    }

243
244
245
246
247
248
249
    private static function get_all_filetypes() {
        return array_keys(self::get_all_filetype_players());
    }


    private static function get_all_filetype_players() {
        /* Keyed by the file type descriptions from the artefact_file_mime_types table */
Penny Leach's avatar
Penny Leach committed
250
        return array(
251
252
253
254
255
256
            'mp3'       => 'html5audio',
            'flv'       => 'html5video',
            'quicktime' => 'qt',
            'wmv'       => 'wmp',
            'mpeg'      => 'qt',
            'avi'       => 'wmp',
257
            'mp4'       => 'html5video',
Son Nguyen's avatar
Son Nguyen committed
258
            'oga'       => 'html5audio',
259
            'ogg'       => 'html5audio',
Son Nguyen's avatar
Son Nguyen committed
260
            'ogv'       => 'html5video',
261
262
            'webm'      => 'html5video',
            '3gp'       => 'html5video',
263
264
            'wav'       => 'html5audio',
            'm4a'       => 'html5audio',
Penny Leach's avatar
Penny Leach committed
265
266
267
        );
    }

268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
    public static function get_download_link(ArtefactTypeFile $artefact, BlockInstance $instance) {
        return get_config('wwwroot') . 'artefact/file/download.php?file='
            . $artefact->get('id') . '&view=' . $instance->get('view');
    }

    public static function get_instance_javascript(BlockInstance $instance) {
        list($artefact, $width, $height) = self::get_mediaplayer_details($instance);
        if (!$artefact) {
            return array();
        }

        $playerclass = self::get_player_class_for_artefact($artefact);
        if (!$playerclass) {
            return array();
        }

        $jsfile = call_static_method($playerclass, 'get_js_library');
        $jsblock = call_static_method($playerclass, 'get_js_initjs', $artefact, $instance, $width, $height);
286
        $extrafilejs = call_static_method($playerclass, 'get_js_library_extra');
287
288
289
290
291
292
293
294

        $js = array();
        if ($jsfile) {
            $js['file'] = $jsfile;
        }
        if ($jsblock) {
            $js['initjs'] = $jsblock;
        }
295
296
297
        if ($extrafilejs) {
            $js['extrafilejs'] = $extrafilejs;
        }
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
        if ($js) {
            return array($js);
        }
        else {
            return array();
        }
    }

    public static function default_copy_type() {
        return 'full';
    }

    /**
     * Fetches the details needed by the mediaplayer renderers
     *
     * @param BlockInstance $instance
     * @return mixed array(ArtefactType $artefact, width, height) or false if no artefact on this block
     */
    public static function get_mediaplayer_details(BlockInstance $instance) {
        $configdata = $instance->get('configdata');
        $viewid = $instance->get('view');
        $artefactid = isset($configdata['artefactid']) ? $configdata['artefactid'] : null;

        // If there is no artefact, then return false
        if (empty($artefactid)) {
            return array(false, false, false);
Penny Leach's avatar
Penny Leach committed
324
325
        }

326
327
        require_once(get_config('docroot') . 'artefact/lib.php');
        $artefact = $instance->get_artefact_instance($artefactid);
328
329
330
331
332
333
334
335

        /**
         * @DEPRECATED: Not currently using configurable heights; instead height & width
         * are dynamically scaled using CSS. Keeping these as placeholders so we don't
         * have to tear out all the width & height display code.
         */
        $width  = self::DEFAULT_WIDTH;
        $height = self::DEFAULT_HEIGHT;
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364

        return array($artefact, $width, $height);
    }
}


/**
 * Hierarchy of classes that hold the code for the different media players
 * we use. See BlocktypeInternalMedia::get_all_filetype_players() for how
 * we map mimetypes to media players.
 */
abstract class MaharaMediaPlayer {

    /**
     * Returns a unique identifier to use in the "id" attributes of the media player. Should be
     * deterministic so that the HTML function can print it, and the script can then find it.
     *
     * @param ArtefactType $artefact
     * @param BlockInstance $block
     */
    protected static function get_unique_id(ArtefactType $artefact, BlockInstance $block) {
        return $block->get('id') . '_' . $artefact->get('id');
    }

    /**
     * Returns the HTML to display the a mediaplayer of this type
     *
     * @param ArtefactType $artefact
     * @param BlockInstance $block
365
366
     * @param int $width @DEPRECATED: Not currently used
     * @param int $height @DEPRECATED: Not currently used
367
368
369
370
371
372
373
374
375
376
377
378
379
     * @return string
     */
    abstract public static function get_html(ArtefactType $artefact, BlockInstance $block, $width, $height);

    /**
     * Returns JS library used to display a mediaplayer of this type.
     * Because Mahara currently ties one init block to one Javascript library loading, this can
     * only currently support one file per player type.
     *
     * @return array
     */
    public static function get_js_library() { return false; }

380
381
382
383
384
385
386
387
388
    /**
     * Returns extra JS library needed display a mediaplayer of this type.
     * in case we need to include more than one js file, eg lang files
     *
     * @return array
     */

    public static function get_js_library_extra() { return false; }

389
390
391
392
393
    /**
     * Returns a JS snippet needed to initialize a mediaplayer of this type (or boolean false if none)
     *
     * @param ArtefactType $artefact
     * @param BlockInstance $block
394
395
     * @param int $width @DEPRECATED: Not currently used
     * @param int $height @DEPRECATED: Not currently used
396
397
398
399
400
401
402
403
404
405
     * @return string|false
     */
    public static function get_js_initjs(ArtefactType $artefact, BlockInstance $block, $width, $height) { return false; }
}

/**
 * Windows Media Player browser plugin
 */
class MaharaMediaPlayer_wmp extends MaharaMediaPlayer {
    public static function get_html(ArtefactType $artefact, BlockInstance $block, $width, $height) {
Penny Leach's avatar
Penny Leach committed
406

407
        $url = hsc(PluginBlocktypeInternalmedia::get_download_link($artefact, $block));
Penny Leach's avatar
Penny Leach committed
408
409
410
411
412
413
414

        $size = 'width="' . $width . '" height="' . $height . '"';
        $autosize = 'false';

        $mimetype = 'video/x-ms-wmv'; // hardcode this
        $autostart = 'false';

415
        return '<span class="mediaplugin mediaplugin_wmp">
Penny Leach's avatar
Penny Leach committed
416
417
418
    <object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" ' . $size . '
      standby="Loading Microsoft(R) Windows(R) Media Player components..."
      type="application/x-oleobject">
419
420
421
422
423
424
425
426
427
428
429
430
     <param name="Filename" value="' . $url . '">' /* hsc($artefact->get('title')) . '"> */ . '
     <param name="src" value="' . $url . '">
     <param name="url" value="' . $url . '">
     <param name="ShowControls" value="true">
     <param name="AutoRewind" value="true">
     <param name="AutoStart" value="' . $autostart . '">
     <param name="Autosize" value="' . $autosize . '">
     <param name="EnableContextMenu" value="true">
     <param name="TransparentAtStart" value="false">
     <param name="AnimationAtStart" value="false">
     <param name="ShowGotoBar" value="false">
     <param name="EnableFullScreenControls" value="true">
431
     <param name="Wmode" value="opaque">
Penny Leach's avatar
Penny Leach committed
432
433
    <!--[if !IE]>-->
      <object data="' . $url . '" type="' . $mimetype . '" ' . $size . '>
434
435
436
437
438
439
       <param name="src" value="' . $url . '">
       <param name="url" value="' . $url . '">
       <param name="controller" value="true">
       <param name="autoplay" value="' . $autostart . '">
       <param name="autostart" value="' . $autostart . '">
       <param name="resize" value="scale">
440
       <param name="wmode" value="opaque">
Penny Leach's avatar
Penny Leach committed
441
442
443
444
      </object>
    <!--<![endif]-->
    </object></span>';
    }
445
}
Penny Leach's avatar
Penny Leach committed
446

447
448
449
450
451
/**
 * Quicktime browser plugin
 */
class MaharaMediaPlayer_qt extends MaharaMediaPlayer {
    public static function get_html(ArtefactType $artefact, BlockInstance $block, $width, $height) {
Penny Leach's avatar
Penny Leach committed
452

453
        $url = PluginBlocktypeInternalmedia::get_download_link($artefact, $block);
Penny Leach's avatar
Penny Leach committed
454
455
456
457

        $size = 'width="' . $width . '" height="' . $height . '"';

        require_once('file.php');
458
        $mimetype = $artefact->get('filetype');
Penny Leach's avatar
Penny Leach committed
459
460
        $autostart = 'false';

461
        return '<span class="mediaplugin mediaplugin_qt">
Penny Leach's avatar
Penny Leach committed
462
463
    <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
      codebase="http://www.apple.com/qtactivex/qtplugin.cab" ' . $size . '>
464
465
     <param name="pluginspage" value="http://www.apple.com/quicktime/download/">
     <param name="src" value="' . $url . '">
466
     <param name="controller" value="true">
467
468
469
470
     <param name="loop" value="false">
     <param name="autoplay" value="' . $autostart . '">
     <param name="autostart" value="' . $autostart . '">
     <param name="scale" value="aspect">
Penny Leach's avatar
Penny Leach committed
471
472
    <!--[if !IE]>-->
      <object data="' . $url . '" type="' . $mimetype . '" ' . $size . '>
473
474
475
476
477
478
479
       <param name="src" value="'.$url.'">
       <param name="pluginurl" value="http://www.apple.com/quicktime/download/">
       <param name="controller" value="true">
       <param name="loop" value="false">
       <param name="autoplay" value="' . $autostart . '">
       <param name="autostart" value="' . $autostart . '">
       <param name="scale" value="aspect">
480
       <param name="wmode" value="transparent">
Penny Leach's avatar
Penny Leach committed
481
482
483
484
      </object>
    <!--<![endif]-->
    </object></span>';
    }
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
}


/**
 * HTLM5 audio player
 */
class MaharaMediaPlayer_html5audio extends MaharaMediaPlayer {

    /**
     * The (current) height, in pixels, of the VideoJS controls.
     * HACK: This height was just found through observation. There's probably
     * a more reliable way to get or control this.
     */
    const VIDEOJS_CONTROL_HEIGHT = 30;

500
    protected static function get_unique_id(ArtefactType $artefact, BlockInstance $block) {
501
502
        return 'audio_' . parent::get_unique_id($artefact, $block);
    }
Penny Leach's avatar
Penny Leach committed
503

504
505
506
507
508
509
510
511
512
    /**
     * Returns html5 code to play the artefact audio
     *
     * @param ArtefactTypeFile $artefact
     * @param BlockInstance $block
     * @param int $width
     * @param int $height
     * @return string
     */
513
    public static function get_html(ArtefactType $artefact, BlockInstance $block, $width, $height) {
514

515
        $url = PluginBlocktypeInternalMedia::get_download_link($artefact, $block);
516
517
518
519
520
521

        require_once('file.php');
        $mimetype = $artefact->get('filetype');
        $filesize = round($artefact->get('size') / 1000000, 2) . 'MB';

        return '
522
523
524
525
526
527
        <audio
            id="' . self::get_unique_id($artefact, $block) . '"
            class="video-js vjs-default-skin vjs-big-play-centered vjs-audio"
            width="' . $width . '"
            height="'.self::VIDEOJS_CONTROL_HEIGHT.'"
        >
528
            <source src="' . $url . '" type="' . $mimetype . '"/>
529
            ' . get_string('browsercannotplay1', 'blocktype.file/internalmedia') . '
530
531
532
533
534
535
536
        </audio>';
    }

    public static function get_js_library() {
        return 'videojs/video.js';
    }

537
    public static function get_js_initjs(ArtefactType $artefact, BlockInstance $block, $width, $height) {
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
        return 'videojs(
            "' . self::get_unique_id($artefact, $block) . '",
            {
                "controls": true,
                "preload": "auto",
                "width": "1000",
                "height": "'.self::VIDEOJS_CONTROL_HEIGHT.'"
            }
        );';
    }
}

/**
 * HTML5 video player
 */
class MaharaMediaPlayer_html5video extends MaharaMediaPlayer {

555
    protected static function get_unique_id(ArtefactType $artefact, BlockInstance $block) {
556
        return 'video_' . parent::get_unique_id($artefact, $block);
557
558
559
560
561
562
563
564
565
566
567
    }

    /**
     * Returns html5 code to play the artefact video
     *
     * @param ArtefactTypeFile $artefact
     * @param BlockInstance $block
     * @param int $width
     * @param int $height
     * @return string
     */
568
    public static function get_html(ArtefactType $artefact, BlockInstance $block, $width, $height) {
569

570
        $url = PluginBlocktypeInternalMedia::get_download_link($artefact, $block);
571
572
573
574
575

        require_once('file.php');
        $mimetype = $artefact->get('filetype');

        return '
576
577
578
579
580
581
        <video
            id="' . self::get_unique_id($artefact, $block) . '"
            class="video-js vjs-default-skin vjs-big-play-centered"
            width="' . $width . '"
            height="' . $height . '"
        >
582
            <source src="' . $url . '" type="' . $mimetype . '"/>
583
            ' . get_string('browsercannotplay1', 'blocktype.file/internalmedia') . '
584
        </video>';
585
586
    }

587
588
    public static function get_js_library() {
        return 'videojs/video.js';
Penny Leach's avatar
Penny Leach committed
589
590
    }

591
592
593
594
595
596
597
598
599
    public static function get_js_library_extra() {
        global $USER;

        $lang = get_user_language($USER->get('id'));
        $lang = str_replace('.utf8', '', $lang);

        return array("videojs/lang/$lang.js");
    }

600
    public static function get_js_initjs(ArtefactType $artefact, BlockInstance $block, $width, $height) {
601
602
603
604
605
606
607
608
609
610
611
612
        global $CFG;
        return 'videojs(
            "' . self::get_unique_id($artefact, $block) . '",
            {
                "controls": true,
                "preload": "auto",
                "fluid": true,
                "width": ' . $width . ',
                "height": ' . $height . ',
                "swf": "' . $CFG->wwwroot . '/artefact/file/blocktype/internalmedia/videojs/video-js.swf"
            }
        );';
613
    }
Penny Leach's avatar
Penny Leach committed
614
}