Affects Version/s: 3.0.4
Create a course with a forum activity Create a topic in the forum Reply to the discussion: Put atto in HTML mode Paste: < video controls width = "640" height = "480" >< source src = "http://cameron1729.xyz/prettygood.mp4" > Oh no! </ video > Switch back to wysiwyg mode Ensure you see the embedded video and can play it Post the reply View the reply and verify you see the embedded video Edit the reply Verify you see the video in the wysiwyg preview Check the HTML view, verify the markup is still OK ( controls may have changed to controls="" , that's OK Make another reply with the following: < audio controls>< source src = "http://cameron1729.xyz/alienpls.wav" > Oh no! </ audio > Check again that you can play the wav file in the wysiwyg editor as well as after saving the reply
- Create a course with a forum activity
- Create a topic in the forum
- Reply to the discussion:
- Put atto in HTML mode
- Switch back to wysiwyg mode
- Ensure you see the embedded video and can play it
- Post the reply
- View the reply and verify you see the embedded video
- Edit the reply
- Verify you see the video in the wysiwyg preview
- Check the HTML view, verify the markup is still OK (controls may have changed to controls="", that's OK
- Make another reply with the following:
- Check again that you can play the wav file in the wysiwyg editor as well as after saving the reply
Fixed Branches:MOODLE_30_STABLE, MOODLE_31_STABLE
Pull from Repository:
Pull Master Branch:
Pull Master Diff URL:
Sprint:3.2 Sprint 3
A user wishes to embed a .wav file into a forum post. Adding the .wav file via the text editor's media button only inserts a hyperlink to the file (see
MDL-54846). Using the text editor's source mode, the user attempts to embed the uploaded .wav file using the HTML 5 audio tag. However, upon saving, the audio tag is automatically removed so the file is not embedded. Using the same code in a page resource, the audio tag is not removed.
STEPS TO REPLICATE
1. Create a forum activity.
2. Add a new post to the forum.
3. Click the Media button on the text editor.
4. Upload a .wav file and then click the insert media button. The .wav file is added to the page as a hyperlink.
5. Click the HTML button on the text editor to switch into source mode.
6. Update the HTML using the HTML 5 audio tag to embed the .wav file into the page. Same code:
7. Submit the post.
8. Read the post. Also edit the post and click the HTML button on the text editor.
The .wav file is not embedded in the HTML. The audio tag has been removed. The resulting HTML:
The audio tag is retained in the HTML. The .wav file is embedded into the forum post allowing the audio file to be played directly from the post.
Behavior has been replicated in 3.0.4 and 2.9.3.
ADDITIONAL INVESTIGATION NOTES
1. The audio tag is removed from the forum post HTML regardless of the file type being embedded. For example, attempting to embed an .mp3 file with the audio tag also results in the audio tag being removed.
2. Behavior was replicated with both the Atto and TinyMCE text editors.
An instructor teaching a sound design course would like for students to be able to share their .wav files within forums. The .wav file format is not among the file formats currently handled by Moodle's media embedding features (see
MDL-54846). A potential work-around would be manually entered the necessary HTML to embed the file, but this cannot be done when the audio tag is automatically removed.