themeum / tutor

A complete WordPress LMS plugin to create any e-learning website easily.
https://tutorlms.com
GNU General Public License v3.0
82 stars 63 forks source link

Plyr Video Player Controls not showing up #1

Open baldawayash15 opened 4 years ago

baldawayash15 commented 4 years ago

Hey there, First things First I am a fan of this great LMS plugin. I like the way the developer folks have contributed and developed the plugin and provided as a free and open source great looking LMS plugin like a cherry on a cake. Coming to the issue I just noted that the LMS plugin is using plyr JS plugin which is also a great alternative to HTML5 video but the player used in the plugin doesn't show up the controls like mute and volume controls. At the beginning it was displaying the full screen and settings menu for video playback only.

To resolve this issue I have followed the documentation for the plugin on GitHub repo. There I found that we can add options directly for the player controls while initializing the plugin. so I have tweaked the given JS code on tutor-front.js file.

Below is the code snippet for reference:


         const player = new Plyr('#tutorPlayer', {
          controls: [
        'play-large', // The large play button in the center
            'restart', // Restart playback
            'rewind', // Rewind by the seek time (default 10 seconds)
        'play', // Play/pause playback
        'fast-forward', // Fast forward by the seek time (default 10 seconds)
        'progress', // The progress bar and scrubber for playback and buffering
        'current-time', // The current time of playback
        'duration', // The full duration of the media
        'mute', // Toggle mute
        'volume', // Volume control
        'captions', // Toggle captions
            'settings', // Settings menu
        'pip', // Picture-in-picture (currently Safari only)
            'airplay', // Airplay (currently Safari only)
        'download', // Show a download button with a link to either the current source or a custom URL you specify in your options
        'fullscreen', // Toggle fullscreen              
           ]
    });

I hope this small solution makes sense for the controls to show up. All the controls are visible on my plugin player.

Thanks :smile:

bluetyphoon77 commented 2 years ago

Hi, I was just searching how to customize the LMSTutor video player because it shows an overlay when we hit pause, and no controls,... Culd you please tell me if this is still the way to do it ? Or is there a simpler way now in 2022 ? thanks a lot