MDL-55324 atto_media: Implement HTML compliant media plugin
This patch completely reworks the atto media plugin to allow insertion of HTML media elements.
This commit is contained in:
@@ -22,10 +22,61 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['add'] = 'Add';
|
||||
$string['addcaptionstrack'] = 'Add caption track';
|
||||
$string['addchapterstrack'] = 'Add chapter track';
|
||||
$string['adddescriptionstrack'] = 'Add description track';
|
||||
$string['addmetadatatrack'] = 'Add metadata track';
|
||||
$string['addsource'] = 'Add alternative source';
|
||||
$string['addsource_help'] = 'It is recommended that an alternative media source is provided, since desktop and mobile browsers vary in which file formats they support.';
|
||||
$string['addsubtitlestrack'] = 'Add subtitle track';
|
||||
$string['addtrack'] = 'Add track';
|
||||
$string['advancedsettings'] = 'Advanced settings';
|
||||
$string['audio'] = 'Audio';
|
||||
$string['audiosourcelabel'] = 'Audio source URL';
|
||||
$string['autoplay'] = 'Play automatically';
|
||||
$string['browserepositories'] = 'Browse repositories...';
|
||||
$string['captions'] = 'Captions';
|
||||
$string['captions_help'] = 'Captions may be used to describe everything happening in the track, including non-verbal sounds such as a phone ringing.';
|
||||
$string['captionssourcelabel'] = 'Caption track URL';
|
||||
$string['chapters'] = 'Chapters';
|
||||
$string['chapters_help'] = 'Chapter titles may be provided for use in navigating the media resource.';
|
||||
$string['chapterssourcelabel'] = 'Chapter track URL';
|
||||
$string['controls'] = 'Show controls';
|
||||
$string['createmedia'] = 'Insert media';
|
||||
$string['default'] = 'Default';
|
||||
$string['descriptions'] = 'Descriptions';
|
||||
$string['descriptions_help'] = 'Audio descriptions may be used to provide a narration which explains visual details not apparent from the audio alone.';
|
||||
$string['descriptionssourcelabel'] = 'Description track URL';
|
||||
$string['displayoptions'] = 'Display options';
|
||||
$string['entername'] = 'Enter name';
|
||||
$string['entersource'] = 'Source URL';
|
||||
$string['enterurl'] = 'Enter URL';
|
||||
$string['height'] = 'Height';
|
||||
$string['kind'] = 'Type';
|
||||
$string['label'] = 'Label';
|
||||
$string['languagesavailable'] = 'Languages available';
|
||||
$string['languagesinstalled'] = 'Languages installed';
|
||||
$string['link'] = 'Link';
|
||||
$string['loop'] = 'Loop';
|
||||
$string['metadata'] = 'Metadata';
|
||||
$string['metadata_help'] = 'Metadata tracks, for use from a script, may be used only if the player supports metadata';
|
||||
$string['metadatasourcelabel'] = 'Metadata track URL';
|
||||
$string['mute'] = 'Muted';
|
||||
$string['pluginname'] = 'Media';
|
||||
$string['poster'] = 'Thumbnail URL';
|
||||
$string['remove'] = 'Remove';
|
||||
$string['size'] = 'Size';
|
||||
$string['srclang'] = 'Language';
|
||||
$string['subtitles'] = 'Subtitles';
|
||||
$string['subtitles_help'] = 'Subtitles may be used to provide a transcription or translation of the dialogue.';
|
||||
$string['subtitlessourcelabel'] = 'Subtitle track URL';
|
||||
$string['track'] = 'Track URL';
|
||||
$string['tracks'] = 'Subtitles and captions';
|
||||
$string['tracks_help'] = 'Subtitles, captions, chapters and descriptions can be added via a WebVTT (Web Video Text Tracks) format file. Track labels will be shown in the selection dropdown menu. For each type of track, any track set as default will be pre-selected at the start of the video.';
|
||||
$string['video'] = 'Video';
|
||||
$string['videoheight'] = 'Video height';
|
||||
$string['videosourcelabel'] = 'Video source URL';
|
||||
$string['videowidth'] = 'Video width';
|
||||
$string['width'] = 'Width';
|
||||
|
||||
|
||||
@@ -28,9 +28,100 @@
|
||||
function atto_media_strings_for_js() {
|
||||
global $PAGE;
|
||||
|
||||
$PAGE->requires->strings_for_js(array('createmedia',
|
||||
'enterurl',
|
||||
$PAGE->requires->strings_for_js(array('add',
|
||||
'addcaptionstrack',
|
||||
'addchapterstrack',
|
||||
'adddescriptionstrack',
|
||||
'addmetadatatrack',
|
||||
'addsource',
|
||||
'addsubtitlestrack',
|
||||
'addtrack',
|
||||
'advancedsettings',
|
||||
'audio',
|
||||
'audiosourcelabel',
|
||||
'autoplay',
|
||||
'browserepositories',
|
||||
'browserepositories',
|
||||
'captions',
|
||||
'captionssourcelabel',
|
||||
'chapters',
|
||||
'chapterssourcelabel',
|
||||
'controls',
|
||||
'createmedia',
|
||||
'default',
|
||||
'descriptions',
|
||||
'descriptionssourcelabel',
|
||||
'displayoptions',
|
||||
'entername',
|
||||
'browserepositories'),
|
||||
'entername',
|
||||
'entersource',
|
||||
'enterurl',
|
||||
'height',
|
||||
'kind',
|
||||
'label',
|
||||
'languagesavailable',
|
||||
'languagesinstalled',
|
||||
'link',
|
||||
'loop',
|
||||
'metadata',
|
||||
'metadatasourcelabel',
|
||||
'mute',
|
||||
'poster',
|
||||
'remove',
|
||||
'size',
|
||||
'srclang',
|
||||
'subtitles',
|
||||
'subtitlessourcelabel',
|
||||
'track',
|
||||
'tracks',
|
||||
'video',
|
||||
'videoheight',
|
||||
'videosourcelabel',
|
||||
'videowidth',
|
||||
'width'),
|
||||
'atto_media');
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the parameters to the JS module.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function atto_media_params_for_js() {
|
||||
global $OUTPUT;
|
||||
global $PAGE;
|
||||
$currentlang = current_language();
|
||||
$langsinstalled = get_string_manager()->get_list_of_translations(true);
|
||||
$langsavailable = get_string_manager()->get_list_of_languages();
|
||||
$params = [
|
||||
'langs' => ['installed' => [], 'available' => []],
|
||||
'help' => []
|
||||
];
|
||||
|
||||
foreach ($langsinstalled as $code => $name) {
|
||||
$params['langs']['installed'][] = [
|
||||
'lang' => $name,
|
||||
'code' => $code,
|
||||
'default' => $currentlang == $code
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($langsavailable as $code => $name) {
|
||||
// See MDL-50829 for an explanation of this lrm thing.
|
||||
$lrm = json_decode('"\u200E"');
|
||||
$params['langs']['available'][] = [
|
||||
'lang' => $name . ' ' . $lrm . '(' . $code . ')' . $lrm, 'code' => $code];
|
||||
}
|
||||
|
||||
$params['help'] = [
|
||||
'addsource' => $OUTPUT->help_icon('addsource', 'atto_media'),
|
||||
'tracks' => $OUTPUT->help_icon('tracks', 'atto_media'),
|
||||
'subtitles' => $OUTPUT->help_icon('subtitles', 'atto_media'),
|
||||
'captions' => $OUTPUT->help_icon('captions', 'atto_media'),
|
||||
'descriptions' => $OUTPUT->help_icon('descriptions', 'atto_media'),
|
||||
'chapters' => $OUTPUT->help_icon('chapters', 'atto_media'),
|
||||
'metadata' => $OUTPUT->help_icon('metadata', 'atto_media')
|
||||
];
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
.atto_form.atto_media #video input,
|
||||
.atto_form.atto_media #audio input,
|
||||
.atto_form.atto_media #link input {
|
||||
box-sizing: border-box;
|
||||
height: inherit;
|
||||
}
|
||||
|
||||
.atto_form.atto_media > .tab-content {
|
||||
max-height: 60vh;
|
||||
overflow-x: hidden;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
margin-left: -20px;
|
||||
margin-right: -21px;
|
||||
}
|
||||
|
||||
.atto_form.atto_media [id$="-advanced-settings"] label {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.atto_form.atto_media label {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.atto_form.atto_media label > span {
|
||||
display: inline-block;
|
||||
min-width: 6em;
|
||||
}
|
||||
|
||||
.atto_form.atto_media .atto_media_track_lang_entry,
|
||||
.atto_form.atto_media .atto_media_track_label_entry {
|
||||
width: 168px;
|
||||
}
|
||||
|
||||
.atto_form.atto_media .atto_media_track_source {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.atto_form.atto_media select {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.atto_form.atto_media [id$="-tracks"] input[type=checkbox] {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.atto_form.atto_media .atto_media_track ~ .atto_media_track {
|
||||
margin-top: 5px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.atto_form.atto_media label.fullwidth {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.atto_media_postersize {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.atto_media_postersize input[type=text] {
|
||||
width: 3em;
|
||||
}
|
||||
|
||||
input[size].atto_media_url_entry {
|
||||
width: calc(100% - 15px);
|
||||
}
|
||||
|
||||
.openmediabrowser {
|
||||
margin-top: -4px;
|
||||
}
|
||||
|
||||
.addcomponent,
|
||||
.removecomponent {
|
||||
font-weight: bold;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.trackhelp {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.atto_form.atto_media .atto_media_source > label {
|
||||
width: calc(100% - 153px);
|
||||
}
|
||||
|
||||
.atto_form.atto_media .atto_media_track_lang_entry,
|
||||
.atto_form.atto_media .atto_media_track_label_entry {
|
||||
width: 116px;
|
||||
}
|
||||
|
||||
.langlabel {
|
||||
width: 42%;
|
||||
}
|
||||
|
||||
.labellabel {
|
||||
width: 44%;
|
||||
}
|
||||
|
||||
.defaultlabel {
|
||||
width: 14%;
|
||||
}
|
||||
|
||||
[data-medium-type=link] label {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
.nav-tabs > .nav-item a.active {
|
||||
color: #555;
|
||||
background-color: #fff;
|
||||
border: 1px solid #ddd;
|
||||
border-bottom-color: transparent;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.atto_form.atto_media .atto_media_track_lang_entry,
|
||||
.atto_form.atto_media .atto_media_track_label_entry {
|
||||
width: 124px;
|
||||
}
|
||||
|
||||
.atto_form.atto_media .atto_media_source > label {
|
||||
width: calc(100% - 168px);
|
||||
}
|
||||
|
||||
.langlabel {
|
||||
width: 42%;
|
||||
}
|
||||
|
||||
.labellabel {
|
||||
width: 44%;
|
||||
}
|
||||
|
||||
.defaultlabel {
|
||||
width: 14%;
|
||||
}
|
||||
@@ -2,25 +2,164 @@
|
||||
Feature: Add media to Atto
|
||||
To write rich text - I need to add media.
|
||||
|
||||
@javascript
|
||||
Scenario: Insert some media
|
||||
Given I log in as "admin"
|
||||
And I follow "Manage private files..."
|
||||
And I upload "lib/editor/atto/tests/fixtures/moodle-logo.webm" file to "Files" filemanager
|
||||
And I click on "Save changes" "button"
|
||||
When I follow "Profile" in the user menu
|
||||
And I follow "Blog entries"
|
||||
And I follow "Add a new entry"
|
||||
And I set the field "Blog entry body" to "<p>Media test</p>"
|
||||
And I select the text in the "Blog entry body" Atto editor
|
||||
And I set the field "Entry title" to "The best video in the entire world (not really)"
|
||||
And I click on "Media" "button"
|
||||
And I click on "Browse repositories..." "button"
|
||||
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
||||
And I click on "moodle-logo.webm" "link"
|
||||
And I click on "Select this file" "button"
|
||||
And I set the field "Enter name" to "It's the logo"
|
||||
And I click on "Insert media" "button"
|
||||
And I click on "Save changes" "button"
|
||||
Then "video" "css_element" should be visible
|
||||
Background:
|
||||
Given I log in as "admin"
|
||||
And I follow "Manage private files..."
|
||||
And I upload "lib/editor/atto/tests/fixtures/moodle-logo.webm" file to "Files" filemanager
|
||||
And I upload "lib/editor/atto/tests/fixtures/moodle-logo.mp4" file to "Files" filemanager
|
||||
And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager
|
||||
And I upload "lib/editor/atto/tests/fixtures/pretty-good-en.vtt" file to "Files" filemanager
|
||||
And I upload "lib/editor/atto/tests/fixtures/pretty-good-sv.vtt" file to "Files" filemanager
|
||||
And I click on "Save changes" "button"
|
||||
And I follow "Profile" in the user menu
|
||||
And I follow "Blog entries"
|
||||
And I follow "Add a new entry"
|
||||
And I set the field "Blog entry body" to "<p>Media test</p>"
|
||||
And I select the text in the "Blog entry body" Atto editor
|
||||
And I set the field "Entry title" to "The best video in the entire world (not really)"
|
||||
And I click on "Media" "button"
|
||||
|
||||
@javascript
|
||||
Scenario: Insert some media as a link
|
||||
Given I click on "Browse repositories..." "button" in the "#id_summary_editor_link .atto_media_source.atto_media_link_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
||||
And I click on "moodle-logo.webm" "link"
|
||||
And I click on "Select this file" "button"
|
||||
And the field "Enter name" matches value "moodle-logo.webm"
|
||||
And I wait until the page is ready
|
||||
And I click on "Insert media" "button"
|
||||
When I click on "Save changes" "button"
|
||||
Then "//a[. = 'moodle-logo.webm']" "xpath_element" should exist
|
||||
|
||||
@javascript
|
||||
Scenario: Insert some media as a plain video
|
||||
Given I click on "Video" "link"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
||||
And I click on "moodle-logo.webm" "link"
|
||||
And I click on "Select this file" "button"
|
||||
And I click on "Add alternative source" "link"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source:nth-of-type(2)" "css_element"
|
||||
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
||||
And I click on "moodle-logo.mp4" "link"
|
||||
And I click on "Select this file" "button"
|
||||
When I click on "Insert media" "button"
|
||||
Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][descendant::source[contains(@src, 'moodle-logo.mp4')]]" "xpath_element" should exist
|
||||
|
||||
@javascript
|
||||
Scenario: Insert some media as a video with display settings
|
||||
Given I click on "Video" "link"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
||||
And I click on "moodle-logo.webm" "link"
|
||||
And I click on "Select this file" "button"
|
||||
And I click on "Display options" "link"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_poster_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
||||
And I click on "moodle-logo.png" "link"
|
||||
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
||||
And I set the field with xpath "//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_width_entry ')]" to "420"
|
||||
And I set the field with xpath "//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_height_entry ')]" to "69"
|
||||
And I click on "Display options" "link"
|
||||
When I click on "Insert media" "button"
|
||||
Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][contains(@poster, 'moodle-logo.png')][@width=420][@height=69]" "xpath_element" should exist
|
||||
|
||||
@javascript
|
||||
Scenario: Insert some media as a video with advanced settings
|
||||
Given I click on "Video" "link"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
||||
And I click on "moodle-logo.webm" "link"
|
||||
And I click on "Select this file" "button"
|
||||
And I click on "Advanced settings" "link"
|
||||
And the field "Show controls" matches value "1"
|
||||
And I set the field "Play automatically" to "1"
|
||||
And I set the field "Muted" to "1"
|
||||
And I set the field "Loop" to "1"
|
||||
When I click on "Insert media" "button"
|
||||
Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][@controls='true'][@loop='true'][@autoplay='true'][@autoplay='true']" "xpath_element" should exist
|
||||
|
||||
@javascript
|
||||
Scenario: Insert some media as a video with tracks
|
||||
Given I click on "Video" "link"
|
||||
And I change window size to "large"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video .atto_media_source.atto_media_media_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
||||
And I click on "moodle-logo.webm" "link"
|
||||
And I click on "Select this file" "button"
|
||||
And I click on "Subtitles and captions" "link"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_subtitles .atto_media_track_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
||||
And I click on "pretty-good-sv.vtt" "link"
|
||||
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
||||
And the field "Label" matches value "Swedish"
|
||||
And the field "Language" matches value "sv"
|
||||
And I click on "Add subtitle track" "link"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_subtitles .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
||||
And I click on "pretty-good-en.vtt" "link"
|
||||
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
||||
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[2]" matches value "English"
|
||||
And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[1]" to "1"
|
||||
And I click on "Captions" "link" in the ".nav-item[data-track-kind='captions']" "css_element"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_captions .atto_media_track_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
||||
And I click on "pretty-good-sv.vtt" "link"
|
||||
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
||||
And I click on "Overwrite" "button"
|
||||
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[3]" matches value "Swedish"
|
||||
And I click on "Add caption track" "link"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_captions .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
||||
And I click on "pretty-good-en.vtt" "link"
|
||||
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
||||
And I click on "Overwrite" "button"
|
||||
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[4]" matches value "English"
|
||||
And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[4]" to "1"
|
||||
And I click on "Descriptions" "link"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_descriptions .atto_media_track_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
||||
And I click on "pretty-good-sv.vtt" "link"
|
||||
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
||||
And I click on "Overwrite" "button"
|
||||
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[5]" matches value "Swedish"
|
||||
And I click on "Add description track" "link"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_descriptions .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
||||
And I click on "pretty-good-en.vtt" "link"
|
||||
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
||||
And I click on "Overwrite" "button"
|
||||
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[6]" matches value "English"
|
||||
And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[5]" to "1"
|
||||
And I click on "Chapters" "link"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_chapters .atto_media_track_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
||||
And I click on "pretty-good-sv.vtt" "link"
|
||||
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
||||
And I click on "Overwrite" "button"
|
||||
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[7]" matches value "Swedish"
|
||||
And I click on "Add chapter track" "link"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_chapters .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
||||
And I click on "pretty-good-en.vtt" "link"
|
||||
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
||||
And I click on "Overwrite" "button"
|
||||
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[8]" matches value "English"
|
||||
And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[8]" to "1"
|
||||
And I click on "Metadata" "link"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_metadata .atto_media_track_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
||||
And I click on "pretty-good-sv.vtt" "link"
|
||||
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
||||
And I click on "Overwrite" "button"
|
||||
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[9]" matches value "Swedish"
|
||||
And I click on "Add metadata track" "link"
|
||||
And I click on "Browse repositories..." "button" in the "#id_summary_editor_video_metadata .atto_media_track~.atto_media_track .atto_media_source.atto_media_track_source" "css_element"
|
||||
And I click on "Private files" "link" in the ".moodle-dialogue-base[aria-hidden='false'] .fp-repo-area" "css_element"
|
||||
And I click on "pretty-good-en.vtt" "link"
|
||||
And I click on "Select this file" "button" in the ".moodle-dialogue-base[aria-hidden='false']" "css_element"
|
||||
And I click on "Overwrite" "button"
|
||||
And the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_label_entry ')])[10]" matches value "English"
|
||||
And I set the field with xpath "(//*[contains(concat(' ', normalize-space(@class), ' '), ' atto_media_track_default ')])[9]" to "1"
|
||||
When I click on "Insert media" "button"
|
||||
Then "//video[descendant::source[contains(@src, 'moodle-logo.webm')]][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='subtitles'][@label='Swedish'][@srclang='sv'][@default='true']][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='subtitles'][@label='English'][@srclang='en'][not(@default)]][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='captions'][@label='Swedish'][@srclang='sv'][not(@default)]][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='captions'][@label='English'][@srclang='en'][@default='true']][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='descriptions'][@label='Swedish'][@srclang='sv'][@default='true']][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='descriptions'][@label='English'][@srclang='en'][not(@default)]][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='chapters'][@label='Swedish'][@srclang='sv'][not(@default)]][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='chapters'][@label='English'][@srclang='en'][@default='true']][descendant::track[contains(@src, 'pretty-good-sv.vtt')][@kind='metadata'][@label='Swedish'][@srclang='sv'][@default='true']][descendant::track[contains(@src, 'pretty-good-en.vtt')][@kind='metadata'][@label='English'][@srclang='en'][not(@default)]]" "xpath_element" should exist
|
||||
|
||||
Vendored
+858
-85
File diff suppressed because it is too large
Load Diff
Vendored
+4
-1
File diff suppressed because one or more lines are too long
Vendored
+858
-85
File diff suppressed because it is too large
Load Diff
+858
-85
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
+54
@@ -0,0 +1,54 @@
|
||||
WEBVTT
|
||||
|
||||
1
|
||||
00:00:00.530 --> 00:00:00.620
|
||||
Hey!
|
||||
|
||||
2
|
||||
00:00:00.620 --> 00:00:00.710
|
||||
Heey!
|
||||
|
||||
3
|
||||
00:00:00.710 --> 00:00:00.800
|
||||
Heeey!
|
||||
|
||||
4
|
||||
00:00:00.800 --> 00:00:00.890
|
||||
Heeeey!
|
||||
|
||||
5
|
||||
00:00:00.890 --> 00:00:00.980
|
||||
Heeeeey!
|
||||
|
||||
6
|
||||
00:00:00.980 --> 00:00:01.070
|
||||
Heeeeeey!
|
||||
|
||||
7
|
||||
00:00:01.070 --> 00:00:01.160
|
||||
Heeeeeeey!
|
||||
|
||||
8
|
||||
00:00:01.160 --> 00:00:01.250
|
||||
Heeeeeeeey!
|
||||
|
||||
9
|
||||
00:00:01.250 --> 00:00:01.340
|
||||
Heeeeeeeey!
|
||||
|
||||
1
|
||||
00:00:01.340 --> 00:00:01.430
|
||||
Heeeeeeeeey!
|
||||
|
||||
1
|
||||
00:00:01.430 --> 00:00:01.510
|
||||
That's
|
||||
|
||||
1
|
||||
00:00:01.510 --> 00:00:01.770
|
||||
Pretty
|
||||
|
||||
1
|
||||
00:00:01.770 --> 00:00:03.970
|
||||
Good!
|
||||
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
WEBVTT
|
||||
|
||||
1
|
||||
00:00:00.530 --> 00:00:00.620
|
||||
Hej!
|
||||
|
||||
2
|
||||
00:00:00.620 --> 00:00:00.710
|
||||
Heej!
|
||||
|
||||
3
|
||||
00:00:00.710 --> 00:00:00.800
|
||||
Heeej!
|
||||
|
||||
4
|
||||
00:00:00.800 --> 00:00:00.890
|
||||
Heeeej!
|
||||
|
||||
5
|
||||
00:00:00.890 --> 00:00:00.980
|
||||
Heeeeej!
|
||||
|
||||
6
|
||||
00:00:00.980 --> 00:00:01.070
|
||||
Heeeeeej!
|
||||
|
||||
7
|
||||
00:00:01.070 --> 00:00:01.160
|
||||
Heeeeeeej!
|
||||
|
||||
8
|
||||
00:00:01.160 --> 00:00:01.250
|
||||
Heeeeeeeej!
|
||||
|
||||
9
|
||||
00:00:01.250 --> 00:00:01.340
|
||||
Heeeeeeeej!
|
||||
|
||||
1
|
||||
00:00:01.340 --> 00:00:01.430
|
||||
Heeeeeeeeej!
|
||||
|
||||
1
|
||||
00:00:01.430 --> 00:00:01.510
|
||||
Det är
|
||||
|
||||
1
|
||||
00:00:01.510 --> 00:00:01.770
|
||||
Ganska
|
||||
|
||||
1
|
||||
00:00:01.770 --> 00:00:03.970
|
||||
Bra!
|
||||
|
||||
@@ -381,9 +381,19 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element implements templatab
|
||||
$link_options->env = 'editor';
|
||||
$link_options->itemid = $draftitemid;
|
||||
|
||||
$args->accepted_types = array('.vtt');
|
||||
$subtitle_options = initialise_filepicker($args);
|
||||
$subtitle_options->context = $ctx;
|
||||
$subtitle_options->client_id = uniqid();
|
||||
$subtitle_options->maxbytes = $this->_options['maxbytes'];
|
||||
$subtitle_options->areamaxbytes = $this->_options['areamaxbytes'];
|
||||
$subtitle_options->env = 'editor';
|
||||
$subtitle_options->itemid = $draftitemid;
|
||||
|
||||
$fpoptions['image'] = $image_options;
|
||||
$fpoptions['media'] = $media_options;
|
||||
$fpoptions['link'] = $link_options;
|
||||
$fpoptions['subtitle'] = $subtitle_options;
|
||||
}
|
||||
|
||||
//If editor is required and tinymce, then set required_tinymce option to initalize tinymce validation.
|
||||
|
||||
Reference in New Issue
Block a user