Search code examples
htmlvideooutputmute

How to disable the video output of an html5 video player


the html5 video player has the mute attribute to mute the audio output, is there someway to "mute" the video output or disable it leaving the audio only?


Solution

  • You could supposedly use the videoTracks API. Though I'm not exactly sure how many browsers support that yet.

    var video = document.getElementById('myVideoId');
    
    video.onloadedmetadata = function (event) {
      video.videoTracks[0].selected = false;
    };