mediaelement / mediaelement-plugins

Plugins for the main mediaelement project
405 stars 137 forks source link

Quality plugin plays mp4 first by default (2nd <source>) and only switches source once. #196

Closed vendbits closed 1 year ago

vendbits commented 3 years ago

I'm using the quality plugin and I'm having a few issues:

  1. The mp4 video (instead of HLS) starts playing when the play button is clicked even though it's the second <source> in the <video> tag.
  2. When I click the other data quality option (data-quality 720), it starts playing the HLS file (as I can see in Inspect Element > Network) But when I try to change the source/quality back/again, it does nothing.
  3. I'm also getting the following warning after clicking the quality switcher: DevTools failed to load SourceMap: Could not load content for https://cdn.jsdelivr.net/npm/hls.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

Live Demo: https://vendbits.com/test/quality-vendbits.html

Code used for quick glance:

HTML:

    <div class="media-wrapper">
        <video id="player1" width="750" height="421" controls preload="none">
             <source type="application/x-mpegURL" src="https://multiplatform-f.akamaihd.net/i/multi/will/bunny/big_buck_bunny_,640x360_400,640x360_700,640x360_1000,950x540_1500,.f4v.csmil/master.m3u8" data-quality="Auto">
             <source type="video/mp4" src="https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/mp4/BigBuckBunny.mp4" data-quality="720">
        </video>
    </div>

JS:

<script>
    var mediaElements = document.querySelectorAll('video, audio');

    for (var i = 0, total = mediaElements.length; i < total; i++) {
        new MediaElementPlayer(mediaElements[i], {
            features: ['playpause', 'current', 'progress', 'duration', 'volume', 'quality', 'fullscreen'],
        });
    }
</script>
vendbits commented 3 years ago

I found a codepen https://codepen.io/jaapmarcus/pen/GRpxZWj a contributor posted in a closed thread here https://github.com/mediaelement/mediaelement-plugins/issues/172 which has the same issue

The video source/quality is not changing as I can see in Inspect Element > Network

Only BigBuckBunny.mp4, and never big_buck_bunny.mp4 is being played even after switching source/quality

Thank you.

digitas-git commented 1 year ago

Has been fixed with release 2.6.3.