Skip to content

Commit

Permalink
Use preferred method for getting videojs player
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Colvard <chris.colvard@gmail.com>
  • Loading branch information
masaball and cjcolvar committed Oct 3, 2023
1 parent 952a9c8 commit 4fddb64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/master_files/_player.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Unless required by applicable law or agreed to in writing, software distributed
<script>
window.addEventListener('message', function(event) {
var command = event.data.command;
let embeddedPlayer = videojs(document.getElementById('video-js-embed-<%= @master_file.id %>_html5_api'))
let embeddedPlayer = videojs.getPlayer('video-js-embed-<%= @master_file.id %>_html5_api');

if (command=='play') embeddedPlayer.play();
else if (command=='pause') embeddedPlayer.pause();
Expand Down

0 comments on commit 4fddb64

Please sign in to comment.