Eugene
November 18, 2024, 5:54pm
1
We use VideoPlayer
from react-datocms
package. The Mux player itself has a loop
attribute https://docs.mux.com/guides/player-customize-look-and-feel#looping-content . When we use boolean value for loop
in VideoPlayer
, this attribute doesnât appear on the Mux player custom element.
So this code:
<VideoPlayer
data={unmaskedData.asset.video}
loop={true}
/>
result in the following output:
But if we use a string value instead of a boolean:
<VideoPlayer
data={unmaskedData.asset.video}
loop={"true"}
/>
it sets the loop
attribute on the custom element:
But at the same time it gives a TS error because it expects a boolean value
roger
November 18, 2024, 5:57pm
2
Hi @Eugene ,
Welcome to the forum, and sorry about that! That looks like a type mismatch bug on our part. Iâll let the devs know and report back once itâs resolved.
roger
November 18, 2024, 7:42pm
4
@Eugene ,
Are you perhaps using this on Next 15? It might be a Mux player issue with that version: https://github.com/muxinc/elements/issues/1015
If youâre NOT on Next 15, could you please let me know your stack and/or provide an reproduction?
Eugene
November 19, 2024, 9:17am
5
Hey @roger , thanks for the quick response! Yes youâre right, we recently upgraded to Next 15. Looks like the same issue.
1 Like
roger
November 19, 2024, 6:16pm
6
Ok, thanks for the confirmation! Iâll let you know once Mux fixes their bug.
In the meantime, I think you can just use the string version and // @ts-expect-error
it with a comment.
(Moderator note: Un-marking thread as âSolvedâ until the upstream Mux bug is fixed)
roger
November 27, 2024, 6:10pm
7
1 Like
roger
December 10, 2024, 8:28pm
8