Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

player.js and hidden from vimeo privacy settings not working #334

Closed
Ravenna opened this issue Oct 19, 2018 · 16 comments
Closed

player.js and hidden from vimeo privacy settings not working #334

Ravenna opened this issue Oct 19, 2018 · 16 comments
Labels
api Issue related to the oEmbed api bug Something isn't working

Comments

@Ravenna
Copy link

Ravenna commented Oct 19, 2018

Expected Behavior

Video embeds successfully

Actual Behavior

Video embeds but vimeo js fails to load the video

Steps to Reproduce

embed a video that is hidden from vimeo and restricted to specific domains using the player.js

I have a business account, paying more than $500 a year and would like to be able to use the player js in a meaningful way. I am loading videos via the player.js. I want the videos hidden from vimeo and embeddable only on my domain as the videos are my IP.

Please advise ASAP

@fisherinnovation
Copy link
Contributor

Thanks for reaching out @Ravenna - To ensure I can attempt to replicate your issue would you mind answering a couple questions,

  • What error or warning (if any) are you seeing when you attempt to embed your private video?
  • Are you embedding the video on the same host which is configured in the video privacy settings (under the 'Specific Domains' configurations)?
  • Are you seeing any other helpful feedback in the browser console when attempting to test your embed?

@luwes luwes added the bug Something isn't working label Oct 22, 2018
@jonascarlbaum
Copy link

jonascarlbaum commented Oct 23, 2018

We have the same issue, I assume.
We have no control over the customers videos, but I can confirm having the same issue on a video that can’t be viewed in Vimeo player directly due to privacy settings and the video can not be found in searches. The video plays on the site when embedded, but not on other sites.

So, without access — to the Vimeo admin account — I presume we have the same issue.

I’m on the iPhone now, but I’ll try to give you the information from memory. Maybe not 100% accurate — but it’ll give you the basic info you need to start pinpointing the problem.

In our case the video embedded is at https://player.vimeo.com/video/ID and the player.js tries to access it by http(s)://vimeo.com/ID and that returns a 404. So there is probably some issue where the exact URL is important but the player.js presumes the later URL is valid in all cases, but I assume it’s not.

The first URL shows privacy restrictions message and the second URL is a 404. By making the second URL accept all videos that is accepted by the first URL the player.js might remain unchanged I guess, if there is downsides of handling the different URL:s client side, so there might be alternative ways of solving the issue, whatever suits you best I guess.

My assumptions might be wrong, but hopefully it can give you some angels to handle the issue.

@luwes
Copy link
Contributor

luwes commented Oct 23, 2018

@jonascarlbaum there is nothing we can do about that. you say you have no control over the customers videos and they chose to make it private. it's normal that you can't embed it on your website then because the customer has configured it that way.

@luwes
Copy link
Contributor

luwes commented Oct 23, 2018

@Ravenna can you check the embed tab and click the embed code button.
Some privacy settings require an extra hash on the vimeo URL.

Embed it like so

<div id="made-in-ny"></div>

<script src="https://player.vimeo.com/api/player.js"></script>
<script>
    var options = {
        url: 'https://vimeo.com/293438045/463ebf7bcf'
    };

    var player = new Vimeo.Player('made-in-ny', options);

    player.setVolume(0);

    player.on('play', function() {
        console.log('played the video!');
    });
</script>

@jonascarlbaum
Copy link

jonascarlbaum commented Oct 23, 2018

Well, I mean I haven’t got the credentials to look at how they’ve set up their privacy settings. We are working on their site and I mean that the affected video shows as embedded IFrame on production, not on stage, so I just wrote that to give you the info that implies that privacy setup — without the need to ask for credentials to look that up in the admin interface.

The private videos are the ones they would like on their production intranet, i presume — that is no issue to me.

We are actually using plyr (https://github.com/sampotts/plyr) that uses player.js — to ease the abstraction level when the customer want the opportunity of using multiple video providers. I need to look closer at this tomorrow.

I can of course ask the customer for the credentials to look things up or ask them to give me a screenshot of the privacy settings.

My initial look into the issue was that there might be a issue in player.js, but it might as well be how player.js is used by plyr.

When reading this thread again I understand that it was unclear what I mean.

We are using plyr that uses player.js, to fill a div with the video embed code you see fit — public or private videos — and that doesn’t work on all videos, even on the site where the restricted video plays when embedded using iframe directly. So the site is the trusted domain the video is aimed at.

All Vimeo videos have played well so far with our setup, 1.5 years, so assumed that there is something on the Vimeo side that have changed, or the privacy settings is new for the customer, and that means the current setup is using player.js in the wrong way.

I’m sorry for the confusion, and I realize that the issue could be on the plyr side as well — or our side, but I didn’t find anything in our code at first glimpse.

I could provide more error trace tomorrow if I can trace the error to your code then.

@Ravenna
Copy link
Author

Ravenna commented Oct 23, 2018

Thanks @jonascarlbaum I will give this a shot later today.

@jonascarlbaum
Copy link

jonascarlbaum commented Oct 23, 2018

@Ravenna guess you mean @luwes 😉

@ahmadawais
Copy link

I have the same issue. Making a course and want the videos to only be available via my website. When I hide from Vimeo and allow on my specific site I get this error.

Failed to load resource: the server responded with a status of 404 (Not Found)
player.es.js:796 Uncaught (in promise) Error: “https://vimeo.com/297488944” was not found.
    at XMLHttpRequest.xhr.onload (player.es.js:796)

@luwes help? This renders hosting on Vimeo useless for private course. It was not like this a month ago.

@jonascarlbaum
Copy link

jonascarlbaum commented Oct 28, 2018

@ahmadawais this error is the exact one I talked about (from memory) — except the .es part of the filename I guess.

@jonascarlbaum
Copy link

jonascarlbaum commented Oct 28, 2018

@ahmadawais I guess the https://player.vimeo.com/video/297488944 url as src in an iframe on your private domain works just fine but not when using a div placeholder and player.js to initialize by id: 297488944?

@ahmadawais
Copy link

I was able to get it working. I have to chose Hide from Vimeo and then add my domain in the embeddable specific sites. No other options work. E.g. the private link option doesn't work.

@luwes
Copy link
Contributor

luwes commented Oct 28, 2018

Thanks for reporting guys. We're aware of the different behavior w/ direct iframe embeds compared to a player.js initialization via id.

When the private link setting is chosen our oEmbed api returns a 404 with only an id in the options which shouldn't be the case, we are working to resolve this soon.

In the mean time you could use the url parameter instead of id taking in account you have to add the hash to the url. For example:

https://vimeo.com/293438045/463ebf7bcf

Notice the id comes first and is followed by this hash 463ebf7bcf after the slash. Our oEmbed API will successfully return for this embed option.

@jonascarlbaum
Copy link

Great, so it’s solvable for me by instructing the customer to change some settings in Vimeo.

But still it should work for us in the first place without workarounds?

@jonascarlbaum
Copy link

Ah, answered @ahmadawais comment.

Seems I need to get access to their account to test and advice them correctly.

For example, we let them put in an url in the cms. We parse url:s to see if it is a valid Vimeo url. Then we parse the id as the last parameter in path. That is no longer valid I suppose. Some url:s they might provide could be with a trailing hash I suppose?

It’s great to hear that you are working on a solution. 👍

@luwes luwes added the api Issue related to the oEmbed api label Oct 31, 2018
@luwes
Copy link
Contributor

luwes commented Oct 31, 2018

This should be resolved. Please let me know if you see otherwise or have any questions. Thanks.

whitelisted domain: https://codepen.io/luwes/pen/mzZgZg
not whitelisted: http://jsfiddle.net/luwes/y51d8f3b/
private link: https://vimeo.com/3198167/0048bd3378

@luwes luwes closed this as completed Oct 31, 2018
@cdiem
Copy link

cdiem commented Feb 27, 2019

It seems that videos protected by private link (without domain protection) don't work.
Player.js gets 404 error from oEmbed API.

screenshot 2019-02-27 at 19 10 22

screenshot 2019-02-27 at 19 25 07

Here's the code:
https://codepen.io/cdiem/pen/ZPGvjZ

Link to the video: https://vimeo.com/320269670/eced817cc0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the oEmbed api bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants