Youtube: For youtube you need to down the files from google-api-php-client and please use this below demo file
$htmlBody = <<
Search Term:
Max Results:
END;
if ($_GET['q'] && $_GET['maxResults']) {
// Call set_include_path() as needed to point to your client library.
require_once 'src/Google_Client.php';
require_once 'src/contrib/Google_YouTubeService.php';
/* Set $DEVELOPER_KEY to the "API key" value from the "Access" tab of the
Google APIs Console
Please ensure that you have enabled the YouTube Data API for your project. */
$DEVELOPER_KEY = 'put your api key here';
$client = new Google_Client();
$client->setDeveloperKey($DEVELOPER_KEY);
(function(window, PhotoSwipe){ document.addEventListener('DOMContentLoaded', function(){ var options = { getImageCaption: function(el){ var captionText, captionEl, captionTextSRC; // Get the caption from the alt tag if (el.nodeName === "IMG"){ captionText = el.getAttribute('alt'); captionTextSRC = el.getAttribute("src"); } var i, j, childEl; for (i=0, j=el.childNodes.length; ichildEl = el.childNodes[i]; if (el.childNodes[i].nodeName === 'IMG'){ captionText = childEl.getAttribute('alt'); captionTextSRC = childEl.getAttribute("src"); } }
//captionEl.appendChild(document.createTextNode(captionText)); return captionEl; // Alternatively you can just pass back a string. However, any HTML // markup will be escaped } }, instance = PhotoSwipe.attach( window.document.querySelectorAll('#Gallery a'), options ); }, false); }(window, window.Code.PhotoSwipe)); function testing() { navigator.notification.alert("Login Successfull"); }