vime-js / vime

Customizable, extensible, accessible and framework agnostic media player. Modern alternative to Video.js and Plyr. Supports HTML5, HLS, Dash, YouTube, Vimeo, Dailymotion...
https://vimejs.com
MIT License
2.75k stars 154 forks source link

fix: Dailymotion qualities selector. #375

Closed ByMykel closed 4 months ago

ByMykel commented 11 months ago

Pull request type

What is the current behavior?

The playback quality selector is not working.

The error is happening because the query is not decoded correctly in parseQueryString. Then in the file below we get a Cannot read properties of undefined besause qualities doesn't exist.

https://github.com/vime-js/vime/blob/0d0df2e861e3378756b9a5df048e753f7289592c/packages/core/src/components/providers/dailymotion/dailymotion.tsx#L338-L343

Input:

event=qualitiesavailable&qualities%5B0%5D=1080&qualities%5B1%5D=720&qualities%5B2%5D=480&qualities%5B3%5D=380

before

{
    "event": "qualitiesavailable",
    "qualities[0]": "1080",
    "qualities[1]": "720",
    "qualities[2]": "480",
    "qualities[3]": "380"
}

after

{
    "event": "qualitiesavailable",
    "qualities": [
        "1080",
        "720",
        "480",
        "380"
    ]
}

What is the new behavior?

Fix the playback quality selector.

Does this introduce a breaking change?

Other information

Before the list of qualities is not displayed:

image

After the change:

image

vercel[bot] commented 11 months ago

@ByMykel is attempting to deploy a commit to the Vidstack Team on Vercel.

A member of the Team first needs to authorize it.