player
player copied to clipboard
Download link not working when already containing URL parameters
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:
- Use URL that contains URL parameters for download link, like
video.mp4?parameter=1 - 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.