nice_build_url() function breaks is default YouTube embed code is passed

This support request was posted in Flatbase by Lost Motion Assembly

Request ID #4902 Resolved
  • Lost Motion Assembly

    It looks like nice_build_ur() expects a scheme to be specified when passing a YouTube embed code. However, YouTube’s embed code doesn’t actually specify a scheme (perhaps YouTube changed something recently). Here’s a sample embed code:

    Note the `src` attribute doesn’t include a scheme. This results in a ‘undefined index’ error. The user can work around this by editing the embed code to include a scheme, but the function should allow for YouTube’s default lack of a scheme.

    Lost Motion Assembly

    Update: the missing sample code:

    Hi,

    Thanks for writing. Unfortunately the code is not copied properly.

    Would you please create a gist on github? http://gist.github.com

    That way we can take a look at it.

    Best,
    Juan.

    Lost Motion Assembly

    Try this:

    Hi,

    I can see what you mean now. Yes, recently YouTube started giving their embed codes without the http protocol in the urls. I don’t know the reason, but it actually doesn’t work.

    You can even try to create a simple html with the code that they are currently providing and you’ll see the results in the browser: https://gist.github.com/juanfraa/b1498483569e51022a3c

    We’ll take a look at this issue and see if we can apply a patch.

    Best,
    Juan

    Lost Motion Assembly

    It looks like YouTube has switched to using a protocol-relative URL scheme as part for their migration over from HTTP to HTTPS. I haven’t dug too deep, but it sounds like this is supported by most modern browsers. At first blush I’d guess you’d want to refactor the function slightly so that the `$scheme` variable is optional.

    Yes, thanks for the suggestion. We’ll need to find a solution.

    Have a nice day,
    Juan.

Viewing 7 posts - 1 through 7 (of 7 total)

This topic is marked as resolved

Only the topic author can re-open this thread.

Login to your Account

Welcome back! Please log in to your account by filling the fields below:

Forgot?

Not a member? Create a free account.

Create a Free Account

You're 27 seconds away from some awesome WordPress free stuff, benefits and more. Create a free account and have access to our free products, benefits and more!

Already have an account? Log in
Secure Server