'ActionText method for of handling of video and playback controls as simply as it does for images?

ActionText with trix editor is incredible for rich text, including images, right out of the box.

It will also allow video upload, however, when it displays the rich text that contains the video, it seems to create an <img> tag with the mp4 (video) file as it's src.

<img src="http://localhost:3000/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBDZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--e9814174dba67538aa8dea33ab87b6302d98a341/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9VY21WemFYcGxYM1J2WDJ4cGJXbDBXd2RwQWdBRWFRSUFBdz09IiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--a777e477dec0d9367d8309b7603c814a23f96840/my_video_file.mp4">

I'm not 100% what it's doing (perhaps its logic is: "I can't play video, so I'll display an image of the video instead")?

Is there any simple way to allow users to drop/drag video files (not links to videos) into an ActionText field and display the video along with playback controls in when the rich text is rendered? (basically, the what ActionText does for images, but for video)

What I know so far

  • This video appears to provide a way (watching now and will update with what I find)
  • I guessed this functionality may be requested by others, but I can't spot anything
  • Other reading on 'manual' approaches here, here, here.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source