sampotts / plyr

A simple HTML5, YouTube and Vimeo player
https://plyr.io
MIT License
26.46k stars 2.92k forks source link

ProgressBar (seek range) not working #2577

Open fouille opened 1 year ago

fouille commented 1 year ago

Expected behaviour

when I play (on wav media audio file) I want to be able to use the progress bar to move forward or backward in the reading.

Actual behaviour

when I click on the progress bar, for example at 50%, the cursor and the media always return to the beginning

Steps to reproduce

Click Play Wait load media audio click pause or click on progress bar for next seconds

Environment

Console errors (if any)

No errors displayed

Link to where the bug is happening

https://user-images.githubusercontent.com/24554441/203805976-58348bc7-2e2f-4415-bf0f-11dd772ea77a.mov

danraniego commented 1 year ago

The same issue in my end but in html5 video.

NotMarra commented 1 year ago

Same issue, but on main website (plyr.io) seem work normally, its weird

alireza2281 commented 1 year ago

I've got the same issue and one more thing that the first time i play the audio the progress bar wont fill till the duration of voice ended and the second time that voice is played the progress bar is filling

frankgalindo-briteris commented 1 year ago

Any updates on this issue?

I'm facing the same problem, but only for small audios(10s).

JulianParge commented 1 year ago

I'm also facing this issue. My files are stored in a CDN. All the files are MP4 format videos. Occasionally it works, other times it doesn't. It generally works fine in the front end of the site, but when you go to the admin section, there is a video preview using the exact same set up and here the progress bar generally doesn't load fully and you can't skip into the video. I'm at a loss on how to fix it.

jmonds commented 6 months ago

It may not be Plyr, but the format of the file. I've been working on creating my own music and converting it from 3ga/m4a to WAV to AAC using NAudio 2.2.1. I found that if the source is mono, the formatting of the file that could make it look twice as a large than it really is. This makes the progress bar jump to the beginning when you click over 50% because there is no content.

The following code fixed my MP3 issue by setting the format to 48000 and 2 channels.

NB: Not using Plyr, but just the default player, would cause the progress bar to be off on the length of the music.

using NAudio.MediaFoundation;
using NAudio.Utils;
using NAudio.Wave;

// Create the MP3 file
// https://www.markheath.net/post/naudio-mediafoundationencoder
using (var reader = new MediaFoundationReader(decompressedFile))
{
    var mediaType = MediaFoundationEncoder.SelectMediaType(
        AudioSubtypes.MFAudioFormat_MP3,
        WaveFormat.CreateIeeeFloatWaveFormat(48000, 2),
        0); // Creates as 96kbps, 0=Select lowest possible bitrate

    using (var enc = new MediaFoundationEncoder(mediaType))
    {
        enc.Encode(mp3File, reader);
    }
}