Skip to content

Feature: Add "high priority" mux data attrs & automatically set video_id for mux data based on playback_id #6

Description

@cjpillsbury

Which Mux Elements/Packages would you like a new feature for?

  • mux-video

🎥 Describe the feature you'd like to request

For high priority mux metadata, it should be easy to set these values via attributes. In addition, if someone is using the playback-id attribute, we should default the video_id metadata to it (unless it's been explicitly provided).

💻 Describe the use cases the feature will solve

Make it simple to add any high priority metadata, since these are the values we want to encourage people to use to help them take full advantage of mux data aggregation.

⭐ Describe the solution you'd like to see

  • Add metadata-[high-priority-metadata-name] attributes to <mux-video />:

    • metadata-video-id (corresponds to video_id)
    • metadata-video-title (corresponds to video_title)
    • metadata-viewer-user-id (corresponds to viewer_user_id)
  • Add video_id defaulting support:

  1. If metadata-video-id attribute is present, use it as the video_id metadata
  2. If metadata-video-id is not present but metadata object is set before load() and has a video_id, use it as the video_id metadata (the same is true for any metadata-[high-priority-metadata-name] attribute)
  3. If neither are present but playback-id is present, use it as the video_id metadata

🔄 Describe alternatives or workarounds you've considered

  • Use a script to createElement('mux-video') then set metadata then attach to the DOM.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestmux-videoRelates to mux-video element

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions