connect()
, initialize()
, and disconnect()
as those are functions for stimulus. Since your ID attribute of your video player is my-video
then you would need to change the selector to document.getElementById('my-video')
import videojs from 'video.js' import 'video.js/dist/video-js.css' $(document).on('turbolinks:load', function(){ let videoPlayer = videojs(document.getElementById('my-video'), { controls: true, playbackRates: [0.5, 1, 2], autoplay: false, fluid: true }) videoPlayer.addClass('video-js') videoPlayer.addClass('vjs-big-play-centered') });
'my-video'
my-video
for the selector, you'd need to set the id attribute.<%= content_tag :video, id: { 'my-video' } do %>
m3u8
file which would best match your bandwidth. This will stream smaller video files of various qualities. You essentially "lose" the capability of being able to download the video file since it's now just a blob reference to the m3u8
. However, there is a lot more involved with transcoding videos with Adaptive Bitrate Streaming. You can check out this video on how I accomplished it.