Skip to content

Commit

Permalink
Youtube Iframe API update
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisblakley committed Oct 20, 2020
1 parent dbe06f8 commit b027752
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/package.json
Expand Up @@ -2,7 +2,7 @@
"name": "nebula-wp",
"title": "Nebula",
"description": "Advanced Starter WordPress Theme for Developers",
"version": "8.5.18",
"version": "8.5.20",
"homepage": "https://gearside.com/nebula/",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion Nebula-Child/assets/css/admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Nebula-Child/resources/sw.js
@@ -1,6 +1,6 @@
//BEGIN automated edits. These will be automatically overwritten.
const THEME_NAME = 'nebula-child';
const NEBULA_VERSION = 'v8.5.18.5361'; //Sunday, October 18, 2020 12:52:05 PM
const NEBULA_VERSION = 'v8.5.20.3575'; //Tuesday, October 20, 2020 8:34:51 AM
const OFFLINE_URL = 'https://nebula.gearside.com/offline/';
const OFFLINE_IMG = 'https://nebula.gearside.com/wp-content/themes/Nebula-main/assets/img/offline.svg';
const OFFLINE_GA_DIMENSION = 'cd2';
Expand Down
2 changes: 1 addition & 1 deletion Nebula-Child/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/admin.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/critical.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/login.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/pre.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion assets/js/nebula.js
Expand Up @@ -4623,6 +4623,7 @@ nebula.addHTML5VideoPlayer = function(id, element){
nebula.youtubeTracking = function(){
nebula.once(function(){
if ( jQuery('iframe[src*="youtube"], .lazy-youtube').length ){
//Load the Youtube iframe API script
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
Expand All @@ -4635,6 +4636,11 @@ function onYouTubeIframeAPIReady(e){
window.performance.mark('(Nebula) Loading Youtube Videos [Start]');
jQuery('iframe[src*="youtube"]').each(function(i){
if ( !jQuery(this).hasClass('ignore') ){ //Use this class to ignore certain videos from tracking
//If this iframe is using a data-src, make sure the src matches
if ( jQuery(this).attr('src').indexOf('youtube') < 0 ){ //If the src does not contain "youtube"
jQuery(this).attr('src', jQuery(this).attr('data-src')); //Update the src to match the data-src attribute. Note: I cannot think of a better way to do this that actually works with the Youtube Iframe API
}

var id = jQuery(this).attr('id');
if ( !id ){
id = jQuery(this).attr('src').split('?')[0].split('/').pop();
Expand Down Expand Up @@ -5064,7 +5070,7 @@ nebula.createVimeoPlayers = function(){
});

if ( typeof videoProgress === 'undefined' ){
videoProgress = {};
var videoProgress = {};
}
};

Expand Down
2 changes: 1 addition & 1 deletion assets/scss/style.scss
Expand Up @@ -4,7 +4,7 @@
Description: Nebula is a springboard WordPress theme framework for developers. Like other WordPress startup themes, it has custom functionality built-in (like shortcodes, styles, and JS/PHP functions), but unlike other themes Nebula is not meant for the end-user.
Author: Pinckney Hugo Group
Author URI: http://www.pinckneyhugo.com
Version: 8.5.18.5362
Version: 8.5.20.3575
License: GNU General Public License v2.0 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: one-column, two-columns, three-columns, four-columns, left-sidebar, right-sidebar, threaded-comments, theme-options, sticky-post, post-formats, microformats, full-width-template, front-page-post-form, flexible-header, featured-images, featured-image-header, editor-style, custom-menu, custom-colors, accessibility-ready
Expand Down
2 changes: 1 addition & 1 deletion inc/data/nebula_theme.json
@@ -1,5 +1,5 @@
{
"version": "8.5.18.5361",
"version": "8.5.20.3575",
"details_url": "https://github.com/chrisblakley/Nebula/commits/main",
"download_url": "https://github.com/chrisblakley/Nebula/archive/main.zip"
}

0 comments on commit b027752

Please sign in to comment.