-
Bug
-
Resolution: Fixed
-
Minor
-
3.4, 3.4.3
-
MOODLE_34_STABLE
-
MOODLE_34_STABLE, MOODLE_35_STABLE
-
MDL-62336_master -
The media_videojs class, in generating the ID attribute for a video/audio tag, will usually assign identical IDs to different video/audio elements when multiples appear in the same content block.
In media_videojs_plugin::embed(),
$attributes = [
'data-setup' => '{' . join(', ', $datasetup) . '}',
'id' => 'id_videojs_' . uniqid() ,
'class' => get_config('media_videojs', $isaudio ? 'audiocssclass' : 'videocssclass')
];
The uniquid() function returns the same value for any given microsecond. Please consider appending a rand() value, e.g. $attributes['id'] = 'id_videojs_' . uniqid() . rand()