Skip to content

Custom rendition names #927

Closed Answered by luwes
nwang92 asked this question in Q&A
Discussion options

You must be logged in to vote

yes, this is possible.

      const renditionMenus = document.querySelectorAll('media-rendition-menu');

      for (const renditionMenu of renditionMenus) {
        renditionMenu.formatMenuItemText = (text, rendition) => {
          console.log(text, rendition);
          return text.replace('1080p', '1080p (HD)');
        }
      }

see an example here https://media-chrome.mux.dev/examples/vanilla/control-elements/media-rendition-menu.html

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by luwes
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #926 on June 21, 2024 14:34.