Videos and API2 shutdown of youtube

Hi there,

I can't implement videos over "embed" anymore from youtube as their API has changed. Until when can I expect an update?

I get a constant message https://youtube.com/devicesupport. 

Thanks,

Chris

4 May 2015

Is this dolphin 7.1 your having problems with?

Others have reported problems with dolphin 7.0, but not 7.1

I just put a youtube video up on my 7.1 site a few seconds ago, and it worked fine.

https://www.deanbassett.com
4 May 2015

You're right. It works again. Was a network issue with my hosting provider.

5 May 2015

Embedding youtube videos is not working anymore for many pages i am hosting.

The youtube response is: https://youtube.com/devicesupport

Anyone have a fix for this? AlexT?

http://www.boonex.com/market/posts/paansystems - your resource for Dolphin Pro
7 May 2015

 

Embedding youtube videos is not working anymore for many pages i am hosting.

The youtube response is: https://youtube.com/devicesupport

Anyone have a fix for this? AlexT?

 

Exact same. YouTube videos will not embed on my  2 established sites both 7.1.5 either.  This cripples my activity.  Any help soon as possible would be fantastic. I'll subscribe to this thread to see if anything develops. Thanks.

8 May 2015

Videozone is out as well... ouch.

ManOfTeal.COM a Proud UNA site, six years running strong!
8 May 2015

Videos will still embed, but the title and description need to be manually filled in. I've reproduced this on a number of devices and servers (including demo.boonex.com). Not sure why some people seem to be unaffected.

 

I PMed AlexT about this a few days ago, but perhaps a proper ticket should be filed.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
8 May 2015

 

I PMed AlexT about this a few days ago, but perhaps a proper ticket should be filed.

 Yes, this should probably be fixed before Dolphin Pro 7.2 is released.

Geeks, making the world a better place
8 May 2015

Obtaining authorization credentials

Your application must have authorization credentials to be able to use the YouTube Data API. This document describes the different types of authorization credentials that the Google Developers Console supports. It also explains how to find or create authorization credentials for your project.

Create your project and select API services

  1. Go to the Google Developers Console.
  2. Select a project.
  3. In the sidebar on the left, select APIs & auth. In the list of APIs, make sure the status is ON for the YouTube Data API v3.
  4. In the sidebar on the left, select Credentials.
  5. The API supports two types of credentials. Create whichever credentials are appropriate for your project:
    • OAuth 2.0: Your application must send an OAuth 2.0 token with any request that accesses private user data. Your application sends a client ID and, possibly, a client secret to obtain a token. You can generate OAuth 2.0 credentials for web applications, service accounts, or installed applications.

      Learn more
    • API keys: A request that does not provide an OAuth 2.0 token must send an API key. The key identifies your project and provides API access, quota, and reports.

      If the key type you need does not already exist, create an API key by selecting Create New Key and then selecting the appropriate key type. Then enter the additional data required for that key type.

      Learn more
      1. Use a server key if your application runs on a server. Do not use this key outside of your server code. For example, do not embed it in a web page. To prevent quota theft, restrict your key so that requests are only allowed from your servers' source IP addresses.
      2. Use a browser key if your application runs on a client, such as a web browser. To prevent your key from being used on unauthorized sites, only allow referrals from domains you administer.
      3. Use an Android key if your application runs on Android devices. To create an Android key, you need to specify the SHA1 fingerprints and package names of the application using that key. Show instructions
      4. Use an iOS key if your application runs on iOS devices. Google verifies that each request originates from an iOS application that matches one of the bundle identifiers you specify. An app's .plist file contains its bundle identifier. Example: com.example.MyApp

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. For details, see our Site Policies.

Last updated April 24, 2014.
Geeks, making the world a better place
8 May 2015

We know what this is really about, it is about making money.

Geeks, making the world a better place
8 May 2015

I really don't understand why we have to jump through all these hoops to just stream a video from Google's YouTube.  You would think they would want as many people possible to stream their videos because of all the bleeding adverts they want everyone to see.  It is bad enough that they are not allowing your site to be returned in their listings if you don't ugly and dumb your site down for a freaking telephone.

Geeks, making the world a better place
8 May 2015

To be clear, the embed itself still works. However, it seems the method Dolphin uses to fetch the video information does not. So this needs to be addressed. I'm off mobile, so I made a ticket: http://www.boonex.com/trac/dolphin/ticket/3518

 

So right now the information needs to be manually entered. Perhaps somebody can find a quick hack to have Dolphin not fetch it and show empty title/description boxes.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
8 May 2015

*bump*

AlexT!!!

http://www.boonex.com/market/posts/paansystems - your resource for Dolphin Pro
10 May 2015

Paan Boonex knows about this.  There are several threads now through out the forum here and a ticket has been created. In fact, the majority of the internet lost their YouTube functionalities, not just us here.  You can google that everyone is fairly angered with the YouTube api change.  I don't know enough yet whether a *fix for this will be helpful or not.  Looks like Youtube wants you to register your site to their api allowing you to maybe only use so much data usage connections to their service at a rate of free.  That is just me talking though.  I have not put it all together yet.

10 May 2015

 

So right now the information needs to be manually entered. Perhaps somebody can find a quick hack to have Dolphin not fetch it and show empty title/description boxes.

Yes; however, it is not fetching the thumbnail either, you get that funky thumb.  So one would need to be able to replace it with a generic thumb that looks a bit better.

Geeks, making the world a better place
10 May 2015

Hmm is there any fix yet ? I know for a fact that my youtube in sounds mod that bought it from Ray still working fine :) while boonex youtube that comes with dolphin not fetching info but the video still work .

Proud Hosted by Zarconia.net
10 May 2015

I already have API credentials for youtube and other Google add ons. So, will Boonex add a section to the admin page for users to input their own API credentials from Google - will that resolve the issue?

caredesign.net
10 May 2015

 

I already have API credentials for youtube and other Google add ons. So, will Boonex add a section to the admin page for users to input their own API credentials from Google - will that resolve the issue?

 
No. it will not. Boonex uses a RSS video feed from the old API to get info about the video. Those are no longer available. So boonex will have to either use the V3 api to fetch info, or there is another way to get video info that does not require the API. Youtube also provides json and xml video info using urls such as this. http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=OjX6xkLfzpI&format=json or this http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=OjX6xkLfzpI&format=xml which can provide the information needed for the video embed without having to use the API. But this will also require rewrites to the code. Either way, code rewrites will be needed.

https://www.deanbassett.com
10 May 2015

Thank you for the report, we will fix it in D 7.2, also I believe that it should be possible to apply the fix to every D 7.1 or maybe 7.0 site.

Rules → http://www.boonex.com/terms
11 May 2015

So if possible alex then give us a process how to please ? As we can't wait till d7.2 fix isn't ? Thank you

Proud Hosted by Zarconia.net
11 May 2015

Yes, we will post the fix after closing the ticket: http://www.boonex.com/trac/dolphin/ticket/3518

We are working on D 7.2 now, so the fix should come shortly.

So if possible alex then give us a process how to please ? As we can't wait till d7.2 fix isn't ? Thank you

 

Rules → http://www.boonex.com/terms
11 May 2015

Hello guys

So far here is a quick fix before the official boonex fix will be available.

My fix is free, so just make sure to apply it very carefully. And I strongly recommend you to to have the official Boonex fix after it's available.

Here is the link - http://www.boonex.com/m/youtube-embed-fix

11 May 2015

 

So far here is a quick fix before the official boonex fix will be available.

 Couldn't get it to work for me.

[edit] I've tried on two sites.

ManOfTeal.COM a Proud UNA site, six years running strong!
11 May 2015

 

 Couldn't get it to work for me.

 me neither, just keep getting Embedding Video Failed

11 May 2015

 

 

 Couldn't get it to work for me.

 me neither, just keep getting Embedding Video Failed

 Me too.

ManOfTeal.COM a Proud UNA site, six years running strong!
11 May 2015

I think you actually need to get your own api key and replace the one in that mod with your own.

https://www.deanbassett.com
11 May 2015

 

http://www.boonex.com/m/youtube-embed-fix

 

 

Thanks Rayz but the fix did not work for me either.  I tried using your code and also replacing the api key string with my own api key and still nothing.

13 May 2015

We use Rayz Advanced Embed and have had no problems at all with YouTube.

13 May 2015

 

We use Rayz Advanced Embed and have had no problems at all with YouTube.

 

Thanks that is good to know.  I intended on getting the module some time ago and got distracted with other things I think. Would you mind pming me your site url to see the mod in action on a live site?

13 May 2015

If you buy the Module, there are some core file edits that need to be done.  There are also adult files, but if you don't want them you will need to delete them from the class file.  The only problems we have had is you have to click outside of the box that you put your link in.

13 May 2015

I tried using your code and also replacing the api key string with my own api key and still nothing.

Same here...

The only problems we have had is you have to click outside of the box that you put your link in.

 That's been the same forever.

 

I too have the Rayz embed module but have not installed it. Looks like I need to install it again. I recently removed it.

ManOfTeal.COM a Proud UNA site, six years running strong!
13 May 2015

Hi All

Just wondering if there's any news on this fix yet? Our members are getting frustrated.

Thanks

Justin 

14 May 2015

Can someone provide a link to a dolphin page with an embeded video that's not working?  I added the "quick fix" code (carefully following the instructions and without changing the key)... plus I updated my browsers to the latest versions... and everything appears to be working fine.  Currently, I'm not using the Video module for very much... but that may change later.  The embeded videos on my site are pretty much all in the forums, events and articles pages. 

Addon: Just to be sure I understand the extend of the problem... does this issue only affect the video module?

http://pkforum.dolphinhelp.com
14 May 2015

One of my site members sent me a few broken video links... so the suggested "fix" did NOT work on my site either.  Can someone explain why is this appears to ONLY be happening in the BoonEx Video module?   

http://pkforum.dolphinhelp.com
16 May 2015

Thanks Rayz!

I installed the fix (http://www.boonex.com/m/youtube-embed-fix) and it works like a charm.

Less than 5 minutes installation.

16 May 2015

The fix provided by Rayz does not work on my site either. Reason is two functions used in his fix that don't appear to exist in default dolphin installs. Wondering if his fix relies on one of his other modules being installed on the site.

Anyhow, i am working on my own fix for this.

https://www.deanbassett.com
16 May 2015

The fix worked for me :)

Proud Hosted by Zarconia.net
16 May 2015

For those having problems with Rayz fix. My solution is below. Your welcome to try it.

Edit modules/boonex/videos/classes/BxVideosConfig.php

Find this section of code.

        if(!defined("YOUTUBE_VIDEO_RSS"))
            define("YOUTUBE_VIDEO_RSS", 'http://gdata.youtube.com/feeds/api/videos/#video#');

Remove that and replace it with this.

        if(!defined("YOUTUBE_VIDEO_RSS"))
             define("YOUTUBE_VIDEO_RSS", 'https://www.googleapis.com/youtube/v3/videos?id=#video#&key=AIzaSyARJDVIUJzjt8XVVg5Ota2poOEsQV2Mcq4&part=snippet,contentDetails');


The google public API access key for server applications is marked in red above. You should replace it with your own key and make sure you activate the Youtube Data API v3 in the google developer console.

Now edit the file. modules/boonex/videos/classes/BxVideosUploader.php

Look for this section of code.

        $sVideoData = $this->embedGetTagContents($sVideoData, "entry");
        if(empty($sVideoData)) return $sErrorReturn;

        $sTitle = $this->embedGetTagContents($sVideoData, "media:title");
        $sDesc = $this->embedGetTagContents($sVideoData, "media:description");
        $sTags = $this->embedGetTagContents($sVideoData, "media:keywords");
        $sImage = $this->embedGetTagAttributes($sVideoData, "media:thumbnail", "url");
        $iDuration = $this->embedGetTagAttributes($sVideoData, "yt:duration", "seconds");

Remove that and replace it with this code.

        if(empty($sVideoData)) return $sErrorReturn;

        $aJson = json_decode($sVideoData,true);

        $sTitle = $aJson['items']['0']['snippet']['title'];
        $sDesc = $aJson['items']['0']['snippet']['description'];
        $sTags = "";
        $sImage = $aJson['items']['0']['snippet']['thumbnails']['default']['url'];

        $sDuration = $aJson['items']['0']['contentDetails']['duration'];
        $aTime = explode("PT", $sDuration);
        $aMins = explode("M", $aTime[1]);
        $aSecs = explode("S", $aMins[1]);
        $iDuration = (int)$aSecs[0] + ((int)$aMins[0]) * 60;


And thats it. Should work with most versions of 7.0.x and all current versions of 7.1.x

Note: This fix uses the json_decode function which is included with php as of php version 5.2.0 and higher. Should not be a issue with most servers unless it's old and has not been updated in a while.

https://www.deanbassett.com
16 May 2015

top man @Deano, as i said before rayz fix didn't work for me, tried the code he supplied, also created a new key myself and still no luck, created a server key and a browser key just to make sure i was trying the right type of key needed, but as i say nothing has worked

16 May 2015

many thanks @Deano, you've come to the rescue yet again, tried your fix directly with the video module and with EVO wall and they both worked perfectly

16 May 2015

If it's anything like what they did with their search engine API a few years ago where you could call up quires, when they stopped that and created an API for search results you where charged for so many calls per month.

Maybe they intend to do the same thing with YouTube where we will be charged for so many embeds or views per month.

It's no skin off their back if they loss websites loading their videos as we all know if you can't pay for your website to stream the videos then users will just not go to your site and use YouTube directly so at the end of the day you will have to pay if you want to keep visitors coming to your website.

I remember their was such as stink up about this when they did it for the search engine feeds, guess now it's YouTube's turn.

Google practically owns the net when it comes to search quires world wide, They can do what they want and you/we will pay if want to part of it and they know that.

16 May 2015

 

For those having problems with Rayz fix. My solution is below. Your welcome to try it.

Edit modules/boonex/videos/classes/BxVideosConfig.php

Find this section of code.

        if(!defined("YOUTUBE_VIDEO_RSS"))
            define("YOUTUBE_VIDEO_RSS", 'http://gdata.youtube.com/feeds/api/videos/#video#');

Remove that and replace it with this.

        if(!defined("YOUTUBE_VIDEO_RSS"))
             define("YOUTUBE_VIDEO_RSS", 'https://www.googleapis.com/youtube/v3/videos?id=#video#&key=AIzaSyARJDVIUJzjt8XVVg5Ota2poOEsQV2Mcq4&part=snippet,contentDetails');


The google public API access key for server applications is marked in red above. You should replace it with your own key and make sure you activate the Youtube Data API v3 in the google developer console.

Now edit the file. modules/boonex/videos/classes/BxVideosUploader.php

Look for this section of code.

        $sVideoData = $this->embedGetTagContents($sVideoData, "entry");
        if(empty($sVideoData)) return $sErrorReturn;

        $sTitle = $this->embedGetTagContents($sVideoData, "media:title");
        $sDesc = $this->embedGetTagContents($sVideoData, "media:description");
        $sTags = $this->embedGetTagContents($sVideoData, "media:keywords");
        $sImage = $this->embedGetTagAttributes($sVideoData, "media:thumbnail", "url");
        $iDuration = $this->embedGetTagAttributes($sVideoData, "yt:duration", "seconds");

Remove that and replace it with this code.

        if(empty($sVideoData)) return $sErrorReturn;

        $aJson = json_decode($sVideoData,true);

        $sTitle = $aJson['items']['0']['snippet']['title'];
        $sDesc = $aJson['items']['0']['snippet']['description'];
        $sTags = "";
        $sImage = $aJson['items']['0']['snippet']['thumbnails']['default']['url'];

        $sDuration = $aJson['items']['0']['contentDetails']['duration'];
        $aTime = explode("PT", $sDuration);
        $aMins = explode("M", $aTime[1]);
        $aSecs = explode("S", $aMins[1]);
        $iDuration = (int)$aSecs[0] + ((int)$aMins[0]) * 60;


And thats it. Should work with most versions of 7.0.x and all current versions of 7.1.x

Note: This fix uses the json_decode function which is included with php as of php version 5.2.0 and higher. Should not be a issue with most servers unless it's old and has not been updated in a while.

 

@Deano, I'm running PHP 5.5 and just applied your fix.  I am getting the same slide in error message of Embedding video failed.  I have applied my own V3 api key and it is activated in my developer control panel.  Returning to the original code on the config file eliminates the error message but no information or thumbnail is retrieved as normal.  I'll keep at it since it appears Boonex isn't in a major hurry to fix one of the primary modules in their platform.  I'm thankful for the service here but getting a little inpatient is all.  I've tried creating a server api key and a browser api key just in case I was doing something wrong. I appreciate your help and others in the community here for trying to fix the problems with Dolphin on a routine bases. You've saved me several times over the years.

Thanks Deano.

18 May 2015

 

@Deano, I'm running PHP 5.5 and just applied your fix.  I am getting the same slide in error message of Embedding video failed.  I have applied my own V3 api key and it is activated in my developer control panel.  Returning to the original code on the config file eliminates the error message but no information or thumbnail is retrieved as normal.  I'll keep at it since it appears Boonex isn't in a major hurry to fix one of the primary modules in their platform.  I'm thankful for the service here but getting a little inpatient is all.  I've tried creating a server api key and a browser api key just in case I was doing something wrong. I appreciate your help and others in the community here for trying to fix the problems with Dolphin on a routine bases. You've saved me several times over the years.

Thanks Deano.

 
There should be no reason why it should not work with php 5.5. Even with my key which is open to the public.

I am willing to take a look if you like.

https://www.deanbassett.com
18 May 2015

Thanks Deano,

 

I will send you the credentials via private message now. 

18 May 2015

 

Thanks Deano,

 

I will send you the credentials via private message now. 

 
Should be fixed now.

https://www.deanbassett.com
19 May 2015

How did you fix this issue?  I have the same problem with the statement coming in, "Video Embed failed" after applying Deano's fix...

 

Thank you for any help

19 May 2015

When applying the fix, this line of code.

$sVideoData = $this->embedReadUrl(str_replace("#video#", $sVideoId, YOUTUBE_VIDEO_RSS));

Which is just above this line of code.

$sVideoData = $this->embedGetTagContents($sVideoData, "entry");

Was accidentally removed.

This line of code....

$sVideoData = $this->embedReadUrl(str_replace("#video#", $sVideoId, YOUTUBE_VIDEO_RSS));

Has to be there. It cannot be removed.

So restore a backup copy of BxVideosUploader.php and try again being very careful as to what lines get removed.


https://www.deanbassett.com
19 May 2015

Thanks its working for me. Just change api key :)

 

Thanks again

20 May 2015

 

$sVideoData = $this->embedReadUrl(str_replace("#video#", $sVideoId, YOUTUBE_VIDEO_RSS));

That fixed it... thank you!  

21 May 2015

Deano thank you very much, it works for me too.

Baloo
21 May 2015
24 May 2015
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.