Plyr expects loop option to be object instead of boolean

Created on 17 June 2024, 6 months ago

Problem/Motivation

The loop option doesn't appear to work as the library expects it to be an object containing a key "active". See the options table on https://github.com/sampotts/plyr

Steps to reproduce

Enable the loop option in the display formatter, go to a page with that display formatter and notice how the video doesn't loop and the JavaScript console shows:

Uncaught TypeError: Cannot create property 'active' on boolean 'true'
    at set loop (plyr.js:1:110805)
    at st.build (plyr.js:1:56734)
    at plyr.js:1:76127

Proposed resolution

Attached patch massages it into the right format in the viewElements method of the PlyrRemoteVideoFormatter class, but ideally we'd want to change the structure of the default option and create an update hook to adjust all display handlers accordingly. Unfortunately, I'm not sure how to update all display handlers like that. I'll try to create an MR for it.

Remaining tasks

Adjust default settings & create update hook to adjust all display handlers.

User interface changes

n/a

API changes

n/a

Data model changes

The loop option needs to be changed from just a boolean to an object containing a "active" key which then contains the boolean.

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇧🇪Belgium seutje Antwerp

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024