-
Notifications
You must be signed in to change notification settings - Fork 6
/
lib.php
646 lines (583 loc) · 26.2 KB
/
lib.php
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
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
324
325
326
327
328
329
330
331
332
333
334
335
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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
<?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/>.
/**
* JW Player media filtering library.
*
* @package filter
* @subpackage jwplayer
* @copyright 2014 Ruslan Kabalin, Lancaster University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/medialib.php');
// Current version of cloud-hosted JW Player.
if (!defined('FILTER_JWPLAYER_CLOUD_VERSION')) {
// This is the only place where version needs to be changed in case of new
// release avialability.
define('FILTER_JWPLAYER_CLOUD_VERSION', '7.8.6');
}
// Size and aspect ratio related defaults.
if (!defined('FILTER_JWPLAYER_VIDEO_WIDTH')) {
// Default video width if no width is specified.
// May be defined in config.php if required.
define('FILTER_JWPLAYER_VIDEO_WIDTH', 400);
}
if (!defined('FILTER_JWPLAYER_VIDEO_WIDTH_RESPONSIVE')) {
// Default video width if no width is specified.
// May be defined in config.php if required.
define('FILTER_JWPLAYER_VIDEO_WIDTH_RESPONSIVE', '100%');
}
if (!defined('FILTER_JWPLAYER_VIDEO_ASPECTRATIO_W')) {
// Default video aspect ratio for responsive mode if no height is specified.
// May be defined in config.php if required.
define('FILTER_JWPLAYER_VIDEO_ASPECTRATIO_W', 16);
}
if (!defined('FILTER_JWPLAYER_VIDEO_ASPECTRATIO_H')) {
// Default video aspect ratio for responsive mode if no height is specified.
// May be defined in config.php if required.
define('FILTER_JWPLAYER_VIDEO_ASPECTRATIO_H', 9);
}
if (!defined('FILTER_JWPLAYER_AUDIO_WIDTH')) {
// Default audio width if no width is specified.
// May be defined in config.php if required.
define('FILTER_JWPLAYER_AUDIO_WIDTH', 400);
}
if (!defined('FILTER_JWPLAYER_AUDIO_HEIGHT')) {
// Default audio heigth if no height is specified.
// May be defined in config.php if required.
define('FILTER_JWPLAYER_AUDIO_HEIGHT', 30);
}
/**
* Effectively, this is a copy of core_media::split_alternatives that does
* not get confused with rtmp:// scheme.
*
* Given a string containing multiple URLs separated by #, this will split
* it into an array of moodle_url objects suitable for using when calling
* embed_alternatives.
*
* Note that the input string should NOT be html-escaped (i.e. if it comes
* from html, call html_entity_decode first).
*
* @param string $combinedurl String of 1 or more alternatives separated by #
* @param int $width Output variable: width (will be set to 0 if not specified)
* @param int $height Output variable: height (0 if not specified)
* @return array Array of 1 or more moodle_url objects
*/
function filter_jwplayer_split_alternatives($combinedurl, &$width, &$height) {
$urls = explode('#', $combinedurl);
$width = 0;
$height = 0;
$returnurls = array();
foreach ($urls as $url) {
$matches = null;
// You can specify the size as a separate part of the array like
// #d=640x480 without actually including a url in it.
if (preg_match('/^d=([\d]{1,4}\.?[\d]*%?)x([\d]{1,4}\.?[\d]*%?)$/i', $url, $matches)) {
$width = $matches[1];
$height = $matches[2];
continue;
} else if (preg_match('/^d=([\d]{1,4}\.?[\d]*%?)$/i', $url, $matches)) {
$width = $matches[1];
continue;
}
// Can also include the ?d= as part of one of the URLs (if you use
// more than one they will be ignored except the last).
if (preg_match('/\?d=([\d]{1,4}\.?[\d]*%?)x([\d]{1,4}\.?[\d]*%?)$/i', $url, $matches)) {
$width = $matches[1];
$height = $matches[2];
// Trim from URL.
$url = str_replace($matches[0], '', $url);
} else if (preg_match('/\?d=([\d]{1,4}\.?[\d]*%?)$/i', $url, $matches)) {
$width = $matches[1];
}
// Clean up url.
$url = filter_var($url, FILTER_VALIDATE_URL);
if (empty($url)) {
continue;
}
// Turn it into moodle_url object.
$returnurls[] = new moodle_url($url);
}
return $returnurls;
}
/**
* Setup filter requirements.
*
* @param moodle_page $page the page we are going to add requirements to.
* @return void
*/
function filter_jwplayer_setup($page) {
global $CFG;
// It is sufficient to load jwplayer library just once.
static $runonce;
if (!isset($runonce)) {
$runonce = true;
} else {
return;
}
$hostingmethod = get_config('filter_jwplayer', 'hostingmethod');
if ($hostingmethod === 'cloud') {
// Well, this is not really a "cloud" version any more, we are just
// using jwplayer libraries hosted on JW Player CDN.
$jwplayer = new moodle_url('https://ssl.p.jwpcdn.com/player/v/' . FILTER_JWPLAYER_CLOUD_VERSION . '/jwplayer');
} else if ($hostingmethod === 'self') {
// For self-hosted option, we are looking for player files presence in
// ./lib/jwplayer/ directory.
$jwplayer = new moodle_url($CFG->httpswwwroot.'/lib/jwplayer/jwplayer');
}
// We need to define jwplayer, since jwplayer doesn't
// define a module for require.js.
$requirejs = 'require.config({ paths: {\'jwplayer\': \'' . $jwplayer->out() . '\'}})';
$page->requires->js_amd_inline($requirejs);
// Set player license key.
$licensekey = get_config('filter_jwplayer', 'licensekey');
$licensejs = 'require.config({ config: {\'filter_jwplayer/jwplayer\': { licensekey: \'' . $licensekey . '\'}}})';
$page->requires->js_amd_inline($licensejs);
}
function filter_jwplayer_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) {
// Check the contextlevel is as expected - if your plugin is a block, this becomes CONTEXT_BLOCK, etc.
if ($context->contextlevel != CONTEXT_SYSTEM) {
return false;
}
// Make sure the filearea is one of those used by the plugin.
if ($filearea !== 'defaultposter' && $filearea !== 'playerskin') {
return false;
}
// Make sure the user is logged in and has access to the module (plugins that are not course modules should leave out the 'cm' part).
require_login($course, true);
// Extract the filename / filepath from the $args array.
$filename = array_pop($args); // The last item in the $args array.
if (!$args) {
$filepath = '/'; // $args is empty => the path is '/'
} else {
$filepath = '/'.implode('/', $args).'/'; // $args contains elements of the filepath
}
// Retrieve the file from the Files API.
$fs = get_file_storage();
$file = $fs->get_file($context->id, 'filter_jwplayer', $filearea, 0, $filepath, $filename);
if (!$file) {
return false; // The file does not exist.
}
// We can now send the file back to the browser - in this case with a cache lifetime of 1 day and no filtering.
send_stored_file($file, 86400, 0, $forcedownload, $options);
}
/**
* JW Player media filtering library.
*
* @package filter
* @subpackage jwplayer
* @copyright 2014 Ruslan Kabalin, Lancaster University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class filter_jwplayer_media extends core_media_player {
/**
* Generates code required to embed the player.
*
* @param array $urls Moodle URLs of media files
* @param string $name Display name; '' to use default
* @param int $width Optional width; 0 to use default
* @param int $height Optional height; 0 to use default
* @param array $options Options array
* image
* use 'image' key with a moodle_url to an image as poster image
* displayed before playback starts.
* subtitles
* use 'subtitles' key with an array of subtitle track files
* in vtt or srt format indexed by label name.
* Example: $options['subtitles']['English'] = http://example.com/english.vtt
* @return string HTML code for embed
*/
public function embed($urls, $name, $width, $height, $options) {
global $PAGE, $CFG;
// We do embedding only here. JW player setup is done in the filter.
$output = '';
$sources = array();
$streams = array();
$playersetupdata = array();
foreach ($urls as $url) {
// Add the details for this source.
$source = array(
'file' => urldecode($url->out(false)),
);
// Help to determine the type of mov.
$ext = core_media::get_extension($url);
if ($ext === 'mov') {
$source['type'] = 'mp4';
}
if ($ext === 'mpd') {
// Dash variable needs to be set if we have a dash stream_bucket_append
$playersetupdata['dash'] = true;
$streams[] = $source;
} else if ($url->get_scheme() === 'rtmp' || $ext === 'm3u8' || $ext === 'smil') {
// For RTMP, HLS and Dynamic RTMP we set rendering mode to Flash to
// ensure streams play is possible even when mp4 fallbacks are given.
$playersetupdata['primary'] = 'flash';
$streams[] = $source;
} else {
$sources[] = $source;
}
}
// Make sure that stream URLs are at the start of the list.
$sources = array_merge($streams, $sources);
if (count($sources) > 0) {
$playerid = 'filter_jwplayer_media_' . html_writer::random_id();
// Process data-jwplayer attributes.
if (!empty($options['htmlattributes'])) {
foreach ($options['htmlattributes'] as $attrib => $atval) {
if (strpos($attrib, 'data-jwplayer-') === 0) {
// Treat attributes starting data-jwplayer as options.
$opt = preg_replace('~^data-jwplayer-~', '', $attrib);
$atval = trim((string) $atval);
if (strpos($atval, ': ') || strpos($atval, '; ') || strpos($atval, ', ')) {
// If attribute contains any of :;, it needs to be split to an array.
$atvalarray = preg_split('~[,;] ~', $atval);
$newatval = array();
foreach ($atvalarray as $dataval) {
$newdata = explode(': ', $dataval, 2);
if (count($newdata) > 1) {
$newdata[1] = trim($newdata[1]);
if (filter_var($newdata[1], FILTER_VALIDATE_URL)) {
// If value is a URL convert to moodle_url.
$newdata[1] = new moodle_url($newdata[1]);
}
$newatval[trim($newdata[0])] = $newdata[1];
} else {
$newdata[0] = trim($newdata[0]);
if (filter_var($newdata[0], FILTER_VALIDATE_URL)) {
// If value is a URL convert to moodle_url.
$newdata[0] = new moodle_url($newdata[0]);
}
$newatval[] = $newdata[0];
}
}
$atval = $newatval;
} else if (filter_var($atval, FILTER_VALIDATE_URL)) {
// If value is a URL convert to moodle_url.
$atval = new moodle_url($atval);
}
$options[$opt] = $atval;
} else {
// Pass any other global HTML attributes to the player span tag.
$globalhtmlattributes = array(
'accesskey',
'class',
'contenteditable',
'contextmenu',
'dir',
'draggable',
'dropzone',
'hidden',
'id',
'lang',
'spellcheck',
'style',
'tabindex',
'title',
'translate'
);
if (in_array($attrib, $globalhtmlattributes) || strpos($attrib, 'data-' === 0)) {
$newattributes[$attrib] = $atval;
}
}
}
}
// Set up playlist.
$playlistitem = array('sources' => $sources);
// Set Title from title attribute of a tag if it has one if not default to filename.
if (isset($options['htmlattributes']['title'])) {
$playlistitem['title'] = (string) $options['htmlattributes']['title'];
} else {
$playlistitem['title'] = $this->get_name('', $urls);
}
// Setup video description.
if (isset($options['description'])) {
$playlistitem['description'] = $options['description'];
}
// Setup video mediaid and use this for the playerid.
if (isset($options['mediaid']) && strlen(trim($options['mediaid']))) {
$playlistitem['mediaid'] = $options['mediaid'];
$playerid = 'filter_jwplayer_media_' . preg_replace('/\s+/', '', $options['mediaid']);
}
// Setup poster image.
if (isset($options['image']) && $options['image'] instanceof moodle_url) {
$playlistitem['image'] = urldecode($options['image']->out(false));
} else if ($poster = get_config('filter_jwplayer', 'defaultposter')) {
$syscontext = context_system::instance();
$playlistitem['image'] = moodle_url::make_pluginfile_url($syscontext->id, 'filter_jwplayer', 'defaultposter', null, null, $poster)->out(true);
}
// Setup subtitle tracks.
if (isset($options['subtitles'])) {
$tracks = array();
foreach ($options['subtitles'] as $label => $subtitlefileurl) {
if ($subtitlefileurl instanceof moodle_url) {
$tracks[] = array(
'file' => urldecode($subtitlefileurl->out(false)),
'label' => $label,
);
}
}
$playlistitem['tracks'] = $tracks;
}
$playersetupdata['playlist'] = array($playlistitem);
// If width and/or height are set in the options override those from URL or defaults.
if (isset($options['width'])) {
$width = $options['width'];
}
if (isset($options['height'])) {
$height = $options['height'];
}
// If we are dealing with audio, show just the control bar.
if (mimeinfo('string', $sources[0]['file']) === 'audio') {
$width = FILTER_JWPLAYER_AUDIO_WIDTH;
$height = FILTER_JWPLAYER_AUDIO_HEIGHT;
}
// If width is not provided, use default.
if (!$width) {
// Use responsive width if choosen in settings otherwise default to fixed width.
if (get_config('filter_jwplayer', 'displaystyle') === 'responsive') {
$width = FILTER_JWPLAYER_VIDEO_WIDTH_RESPONSIVE;
} else {
$width = FILTER_JWPLAYER_VIDEO_WIDTH;
}
}
if (is_numeric($width)) {
$width = round($width);
}
$playersetupdata['width'] = $width;
// If width is a percentage surrounding span needs to have its width set so it does not default to 0px.
$outerspanargs = array('class' => 'filter_jwplayer_playerblock');
if (!is_numeric($width)) {
$outerspanargs['style'] = 'width: '.$width.';';
$width = '100%'; // As the outer span in now at the required width, we set the width of the player to 100%.
}
// Automatically set the height unless it is specified.
if ($height) {
if (is_numeric($height)) {
$playersetupdata['height'] = $height;
} else if (is_numeric($width)) {
// If width is numeric and height is percentage, calculate height from width.
$playersetupdata['height'] = round($width * floatval($height) / 100);
} else {
// If width is also percentage, then set aspect ratio.
$playersetupdata['aspectratio'] = "100:".floatval($height);
}
} else {
if (is_numeric($width)) {
// If width is numeric calculate height from default aspect ratio.
$playersetupdata['height'] = round($width * FILTER_JWPLAYER_VIDEO_ASPECTRATIO_H / FILTER_JWPLAYER_VIDEO_ASPECTRATIO_W);
} else if (isset($options['aspectratio'])) {
// Responsive videos need aspect ratio set to automatically set height, if this is set in $options use that.
$playersetupdata['aspectratio'] = $options['aspectratio'];
} else {
// Use default aspectration.
$playersetupdata['aspectratio'] = FILTER_JWPLAYER_VIDEO_ASPECTRATIO_W.":".FILTER_JWPLAYER_VIDEO_ASPECTRATIO_H;
}
}
// Set additional player options: autostart, mute, controls, repeat, hlslabels, androidhls, primary.
if (isset($options['autostart'])) {
$playersetupdata['autostart'] = $options['autostart'];
}
if (isset($options['mute'])) {
$playersetupdata['mute'] = $options['mute'];
}
if (isset($options['controls'])) {
$playersetupdata['controls'] = $options['controls'];
}
if (isset($options['repeat'])) {
$playersetupdata['repeat'] = $options['repeat'];
}
if (isset($options['hlslabels']) && is_array($options['hlslabels'])) {
$playersetupdata['hlslabels'] = $options['hlslabels'];
}
if (isset($options['androidhls'])) {
$playersetupdata['androidhls'] = $options['androidhls'];
}
if (isset($options['primary'])) {
// if primary is set in $options then this will override all defaults including those for streams set above.
$playersetupdata['primary'] = $options['primary'];
}
// Load skin.
if ($customskincss = get_config('filter_jwplayer', 'customskincss')) {
$playersetupdata['skin'] = $customskincss;
} else if ($skin = get_config('filter_jwplayer', 'skin')) {
$playersetupdata['skin'] = $skin;
}
// Set Google Analytics settings if enabled.
if (get_config('filter_jwplayer', 'googleanalytics')) {
if (isset($options['gaidstring'])) {
$gaidstring = $options['gaidstring'];
} else {
$gaidstring = get_config('filter_jwplayer', 'gaidstring');
}
if (isset($options['galabel'])) {
$galabel = $options['galabel'];
} else {
$galabel = get_config('filter_jwplayer', 'galabel');
}
$playersetupdata['ga'] = array(
'idstring' => $gaidstring,
'label' => $galabel
);
}
$playersetup = new stdClass();
$playersetup->playerid = $playerid;
$playersetup->setupdata = $playersetupdata;
// Add download button if required and supported.
if (get_config('filter_jwplayer', 'downloadbutton') && !count($streams)) {
$playersetup->downloadbtn = array(
'img' => $CFG->wwwroot.'/filter/jwplayer/img/download.png',
'tttext' => get_string('videodownloadbtntttext', 'filter_jwplayer'),
);
}
// Pass the page context variables for logging
$playersetup->logcontext = $PAGE->context->id;
$playersetup->logevents = $this->get_supported_events();
// Set required class for player span tag.
if (isset($options['htmlattributes']['class'])) {
$newattributes['class'] .= ' filter_jwplayer_media';
} else {
$newattributes['class'] = 'filter_jwplayer_media';
}
// Set up the player.
$PAGE->requires->js_call_amd('filter_jwplayer/jwplayer', 'setupPlayer', array($playersetup));
$playerdiv = html_writer::tag('span', $this->get_name('', $urls), array('id' => $playerid));
$outerspan = html_writer::tag('span', $playerdiv, $outerspanargs);
$output .= html_writer::tag('span', $outerspan, $newattributes);
}
return $output;
}
/**
* Gets the list of file extensions supported (enabled) by this media player.
*
* @return array Array of strings (extension not including dot e.g. 'mp3')
*/
public function get_supported_extensions() {
return explode(',', get_config('filter_jwplayer', 'enabledextensions'));
}
/**
* Gets the list of events supported (enabled) by this media player.
*
* @return array Array of strings
*/
public function get_supported_events() {
return explode(',', get_config('filter_jwplayer', 'enabledevents'));
}
/**
* Lists keywords that must be included in a url that can be embedded with
* this media player.
*
* @return array Array of keywords to add to the embeddable markers list
*/
public function get_embeddable_markers() {
$markers = parent::get_embeddable_markers();
// Add RTMP support if enabled.
if (get_config('filter_jwplayer', 'supportrtmp')) {
$markers[] = 'rtmp://';
}
return $markers;
}
/**
* Generates the list of file extensions supported by this media player.
*
* @return array Array of strings (extension not including dot e.g. 'mp3')
*/
public function list_supported_extensions() {
$video = array('mp4', 'm4v', 'f4v', 'mov', 'flv', 'webm', 'ogv');
$audio = array('aac', 'm4a', 'f4a', 'mp3', 'ogg', 'oga');
$streaming = array('m3u8', 'smil', 'mpd');
return array_merge($video, $audio, $streaming);
}
/**
* Generates the list of supported events that can be logged.
*
* @return array Array of strings
*/
public function list_supported_events() {
$events = array(
'playAttempt',
'play',
'buffer',
'pause',
'idle',
'complete',
'error',
'setupError',
'seek',
'visualQuality',
'levelsChanged',
'audioTrackChanged',
'captionsChanged',
);
return $events;
}
/**
* Given a list of URLs, returns a reduced array containing only those URLs
* which are supported by this player. (Empty if none.)
* @param array $urls Array of moodle_url
* @param array $options Options (same as will be passed to embed)
* @return array Array of supported moodle_url
*/
public function list_supported_urls(array $urls, array $options = array()) {
$extensions = $this->get_supported_extensions();
$result = array();
foreach ($urls as $url) {
// If RTMP support is disabled, skip the URL.
if (!get_config('filter_jwplayer', 'supportrtmp') && ($url->get_scheme() === 'rtmp')) {
continue;
}
// If RTMP support is enabled, URL is supported.
if (get_config('filter_jwplayer', 'supportrtmp') && ($url->get_scheme() === 'rtmp')) {
$result[] = $url;
continue;
}
if (in_array(core_media::get_extension($url), $extensions)) {
// URL is matching one of enabled extensions.
$result[] = $url;
}
}
return $result;
}
/**
* Gets the ranking of this player.
*
* See parent class function for more details.
*
* @return int Rank
*/
public function get_rank() {
return 1;
}
/**
* Checks if player is enabled.
*
* @return bool True if player is enabled
*/
public function is_enabled() {
global $CFG;
$hostingmethod = get_config('filter_jwplayer', 'hostingmethod');
$licensekey = get_config('filter_jwplayer', 'licensekey');
if (($hostingmethod === 'cloud') && empty($licensekey)) {
// Cloud mode, but no license key.
return false;
}
$hostedjwplayerpath = $CFG->libdir . '/jwplayer/jwplayer.js';
if (($hostingmethod === 'self') && (!is_readable($hostedjwplayerpath) || empty($licensekey))) {
// Self-hosted mode, but no jwplayer files and/or no license.
return false;
}
return true;
}
}