0

I want to always show seekbar but disable interraction with it, so I find this old plugin (videojs-disable-progress) which seems to work great but not for me

Tried to change vjs to videojs on the plugin import adn on the concerned plugin file

even try to modify a bit the code to update it ton videojs 7 but nothing work Maybe I don't set the pluggin the right way

my .html

<!doctype html>

<html lang="fr">

<head>
  <!-- meta -->
  <meta charset="utf-8">
  <title>test</title>

  <link href="css/styles.css" rel="stylesheet">
  <link href="css/video-js.css" rel="stylesheet">

</head>

<body>
  <video id='myvideo' class='video-js vjs-default-skin vjs-big-play-centered' preload="auto"
    oncontextmenu="return false" width="100%" height="100%" controls
    data-setup='{ "aspectRatio":"16:9", "fluid": true}'>
    <!--ontimeupdate="checkChapter()"-->
    <source src='vid/rg.mp4' type='video/mp4'>
  </video>

</body>
<script src='js/video.js'></script>
<script src='js/videojs.disableProgress.js'></script>
<script src="js/script.js"></script>

</html>

.js

//change vjs to videojs
videojs.plugin('disableProgress', disableProgress);
var enabled = false;
var myPlayer = videojs('myvideo');
myPlayer.disableProgress.disable();

Got this

script.js: Uncaught ReferenceError: disableProgress is not defined
Valoute_GS
  • 25
  • 7
  • are you firing your script on `document::ready`? – GrafiCode Jun 17 '19 at 10:21
  • I don't think was, maybe the reason why, idk. But I find a more simple way to do it without the pluggin, thank tho For people who care : document.querySelector(".vjs-progress-control").style.pointerEvents = "none"; – Valoute_GS Jun 19 '19 at 07:12

1 Answers1

2

Components inclding the progress bar have a disable() method to turn on the event handlers. myPlayer.controlBar.progressControl.disable()

misterben
  • 7,455
  • 2
  • 26
  • 47