plyr icon indicating copy to clipboard operation
plyr copied to clipboard

Captions duplicated for Vimeo

Open matoni555 opened this issue 6 years ago • 37 comments

Hello, I use player with Vimeo video with captions. But captions are duplicated and too big: plyr-vimeo-captions

Expected behaviour

Not duplicated captions. Too big captions hidden.

Actual behaviour

Captions duplicated and too big.

Environment

  • Browser: Chrome
  • Version: 65.0.3325.181
  • Operating System: Windows
  • Version: 11

Thank you

matoni555 avatar Apr 09 '18 08:04 matoni555

What size screen? I'm not sure we can do a lot about this as Vimeo doesn't let you disable their caption rendering via their API.

sampotts avatar Apr 09 '18 08:04 sampotts

I use iframe size same as in screenshot above: 338x190 px. It is strange that in Vimeo captions example are captions small: https://help.vimeo.com/hc/en-us/articles/224968828-Captions-and-subtitles

matoni555 avatar Apr 09 '18 08:04 matoni555

It's because we have to do some magic to hide the Vimeo controls which means Vimeo thinks the window is large and renders the captions to match. It's pretty painful to work with.

sampotts avatar Apr 09 '18 11:04 sampotts

This should be resolved in v3.2.0 👍 Feel free to re-open if not.

sampotts avatar Apr 17 '18 14:04 sampotts

@sampotts This issue is not resolved. Captions are still too big, see http://www.matonoha.cz/_html/plyr/

Thanks

matoni555 avatar May 23 '18 20:05 matoni555

I think that size combined with multi-line cues is more than the css hack can handle, but maybe Sam has some tricks up his sleeves.

If you meant the actual size, it is ok imo. I wouldn't want it much smaller anyway. If you do you can change it with css. Perhaps it could be positioned closer to the bottom with small iframes/viewports.

friday avatar May 23 '18 22:05 friday

This is a tricky one. I need to take another look as Vimeo doesn't seem to allow you to turn off their rendering of the captions without them also not being available via the API if I remember correctly. The offset hack to hide the controls also means the captions get larger (they must use some sort of responsive type mechanism) so it's a fine balance. I'll take another look as this is a good example to test with.

sampotts avatar May 23 '18 23:05 sampotts

Do we think this is something that can be fixed? If not has anyone else discovered any other work arounds? Thanks, Sam

samhibberd avatar Dec 10 '18 17:12 samhibberd

It's not possible to get cues via the Vimeo API unless you enable captions and use the change event. If you enable them it's not possible to hide them safely. The css hack which is currently used doesn't work for all resolutions.

So I would say no, it's not something that can be fixed.

You can disable captions, not use Vimeo, or use their own player.

friday avatar Dec 10 '18 18:12 friday

Thanks for the clarification @friday

samhibberd avatar Dec 11 '18 08:12 samhibberd

How do you disable captions if you don't have control over the source vimeo material?

xnetdude avatar Jun 22 '19 22:06 xnetdude

Hi Guys, I came up to the same issue here. I've been trying to do some workaround but with no success. My first idea was to hide the caption inside the iFrame with javascript, but I get cross-origin issue .

The easier way to 'fix' it would be to force a display:none in the class '.vp-captions' inside the iframe. But i cant do that =( image

Any of you guys found a way to fix it?

Thanks

diegoalex avatar Jul 08 '20 15:07 diegoalex

If you want to control aspects like this hosting your own HTML5 video or streaming it is the only way. Vimeo and YouTube will always want to put their own brand on the player, which is reasonable seeing as they pay for the hosting and bandwith.

friday avatar Jul 08 '20 15:07 friday

If you want to control aspects like this hosting your own HTML5 video or streaming it is the only way. Vimeo and YouTube will always want to put their own brand on the player, which is reasonable seeing as they pay for the hosting and bandwith.

But the Subtitle issue is something related to PLYR, when I open the vimeo video embed somewhere it does't happen. If you check the CSS inside the iFrame you can see that: image

For some reason, when you're wrapped by the PLYR it adds this huge font-size.

diegoalex avatar Jul 08 '20 16:07 diegoalex

Just wanted to bump this issue, encountered it after thinking Vimeo captions were working well. The strange thing is they worked fine when testing on this video embed: <iframe src="https://player.vimeo.com/video/76979871?loop=false&amp;byline=false&amp;portrait=false&amp;title=false&amp;speed=true&amp;transparent=0&amp;gesture=media" allowfullscreen allowtransparency allow="autoplay" ></iframe>

But then when I actually plugged in the client's videos and subtitles, the huge captions appeared. I'm not sure exactly what the difference is here, maybe just the example video had short enough captions that the huge captions didn't quite break out of the hidden iframe?

explorier avatar Oct 02 '20 20:10 explorier

I'm experiencing the same issue as well. I've noticed that it only happens with long sentences. When I reduce the .vp-captions font-size by ~5%, they don't seem to appear anymore (with my sentence lengths). Is there a way that I can tune the 'offset hack'? That way I can potentially reduce the duplicate subtitles somewhat.

sjonkeesse avatar Oct 06 '20 18:10 sjonkeesse

I'm experiencing the same issue as well. I've noticed that it only happens with long sentences. When I reduce the .vp-captions font-size by ~5%, they don't seem to appear anymore (with my sentence lengths). Is there a way that I can tune the 'offset hack'? That way I can potentially reduce the duplicate subtitles somewhat.

I see this working as well when I insert it straight into my browser inspector. But not when adding it to my CSS file, or as inline style in my DOM. It does not affect elements in the iframe. How should this work?

michelstomp avatar Nov 10 '20 10:11 michelstomp

I'm getting the same issue on Vimeo-hosted videos passed through Plyr (latest version on Chrome macOS). Looks like it's only happening when captions are a bit longer.

Here's a demo: Demo Screen Recording

Any thoughts on what can be done @sampotts ?

Thank you!

oalexdoda avatar Dec 10 '20 17:12 oalexdoda

Following up here, @sampotts - my devs couldn't find a quick workaround. Any idea on why Plyr might mess up formatting for longer Vimeo captions?

oalexdoda avatar Dec 22 '20 16:12 oalexdoda

It's because we can't actually hide the Vimeo captions. I'd need to check again but there was previously no way to disable the built-in captions via the available options. All we can do is hide them via the same technique we use to hide their controls but this has the effect of making the captions huge because Vimeo thinks the window is massive.

sampotts avatar Dec 22 '20 20:12 sampotts

Yeah, but it doesn’t happen with the regular Vimeo captions and it’s only for captions that are longer.

Are you sure it’s not something related to the Plyr wrapper and the way it affects the iFrame? On Dec 22, 2020, 10:49 PM +0200, Sam Potts [email protected], wrote:

It's because we can't actually hide the Vimeo captions. I'd need to check again but there was previously no way to disable the built-in captions via the available options. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

oalexdoda avatar Dec 22 '20 20:12 oalexdoda

You can try it. Get the iframe URL, open it and resize the window to full screen. Big captions. Because we only resize vertically and that must be what Vimeo bases the resizing on, it makes the problem worse as the captions wrap and become taller vertically, overlapping into the part of the player that's visible. The only ways it can be resolved are:

  • we disable the custom caption rendering
  • Vimeo adds an option to their player.js API

sampotts avatar Dec 22 '20 20:12 sampotts

Could we ALL try to communicate with Vimeo so that they add the proper option to their player.js.API? How could we all of us, as a bunch, make sure they know we would need them to add such an option? Sorry if I seem too naive but things also work like this (sometimes); by talking. Any ideas?

Tumbuctoo avatar Jan 28 '21 15:01 Tumbuctoo

Did anybody find a workaround?

oalexdoda avatar Mar 01 '21 05:03 oalexdoda

As said, it seems as there is no workaround unless talking to Vimeo staff.

Tumbuctoo avatar Mar 01 '21 09:03 Tumbuctoo

Hey guys I've been at this issue for some time now, since I use it in production.

I have found a fix but need to test further... It actually uses an open issue in Vimeo's player.js here I actually initialize the vimeo player with background: true which inadvertently also removes the exaggerated captions...

It sounds so hacky but it is a quick fix.

I love this player and am open to feedback and tests about this fix. I can also create a PR if necessary

Thanks guys for your efforts.

crispycrispycrispy avatar Mar 31 '21 08:03 crispycrispycrispy

Same issue happening here. Got this in production...

darkylmnx avatar Apr 09 '21 01:04 darkylmnx

i just opened this related issue. it might help us all get it on Vimeo's radar if there are more thumbs up on it https://github.com/vimeo/player.js/issues/747

irasantiago avatar Aug 10 '21 22:08 irasantiago

Hey guys I've been at this issue for some time now, since I use it in production.

I have found a fix but need to test further... It actually uses an open issue in Vimeo's player.js here I actually initialize the vimeo player with background: true which inadvertently also removes the exaggerated captions...

It sounds so hacky but it is a quick fix.

I love this player and am open to feedback and tests about this fix. I can also create a PR if necessary

Thanks guys for your efforts.

This worked for me too, effective way to hide the texttrack from plyr without messing around with elements inside the iframe

modi98 avatar Aug 26 '21 15:08 modi98

Hey guys I've been at this issue for some time now, since I use it in production.

I have found a fix but need to test further... It actually uses an open issue in Vimeo's player.js here I actually initialize the vimeo player with background: true which inadvertently also removes the exaggerated captions...

It sounds so hacky but it is a quick fix.

I love this player and am open to feedback and tests about this fix. I can also create a PR if necessary

Thanks guys for your efforts.

Hi @crispycrispycrispy and @modi98. Is this still working for you in early 2024? Would you mind please sharing a link?

reubenfield avatar Feb 28 '24 05:02 reubenfield