player icon indicating copy to clipboard operation
player copied to clipboard

Download link not working when already containing URL parameters

Open AgentSmith0 opened this issue 1 year ago • 0 comments

Current Behavior:

When the video file contains URL parameters, the download link is not working anymore.

Expected Behavior:

Vidstack doesn't append the download parameter to the download link (?download=filename).

Steps To Reproduce:

  1. Use URL that contains URL parameters for download link, like video.mp4?parameter=1
  2. Vidstack appends another filename parameter which makes the URL invalid, like video.mp4?parameter=1?download=filename

Environment:

  • Framework: CDN
  • Device: Any
  • OS: Any
  • Browser: Any

Anything Else?

This is the problematic line: https://github.com/vidstack/player/blob/main/packages/vidstack/src/elements/define/layouts/default/ui/buttons.ts#L243C1 You can either remove it completely, or just check if the URL already contains URL parameters.

AgentSmith0 avatar Aug 24 '24 14:08 AgentSmith0