var pScript = document.createElement(“script”);
pScript.type = ‘text/javascript’;
pScript.src = ‘//embed.sendtonews.com/player3/embedcode.js?fk=’ + fkId + ‘&cid=5945&offsetx=0&offsety=0&floatwidth=400&floatposition=bottom-right’;
pScript.async = true;
pScript.setAttribute(‘data-type’, ‘s2nScript’); //pScript[‘data-type’] = ‘s2nScript’;
elem.append(pHtml);
elem.append(pScript);
},
insertVideoFuel: function(channelId) {
var u = ‘https://spreadsheets.google.com/feeds/list/1jVoUBFY2Xpt9g_eSOhoUipSA_OOh7hMbPDYAqYWx3nI/1/public/values?alt=json’;
$.ajax({
type: ‘GET’,
url: u,
cache: true,
dataType: ‘json’,
success: function (response) {
if ( typeof(response.feed) !== ‘undefined’ ) {
var img_url = ‘https://res.cloudinary.com/review-journal/image/upload/f_auto,q_auto,c_scale,w_1200/v1611081380/webdev/New7at7onGray.jpg’; //response.feed.entry[0][‘gsx$imageurl’][‘$t’];
var description = response.feed.entry[0][‘gsx$description’][‘$t’];
var elem = $(‘#stn-in-article-player’);
var pHtml = $(”,{‘data-channel’:channelId,’data-poster-image’:img_url,’data-autoplay’:’true’,’data-muted’:’true’,’data-floating’:’true’});
var click_url = ‘/7at7/?utm_campaign=7at7&utm_medium=insert_widget&utm_source=article_page’;
var f_title = $(”,{‘class’:’f-title’}).append(
$(‘‘,{‘href’:click_url, ‘alt’:’7at7′}).append(
$(‘‘,{‘html’:’Watch ‘})
).append(
$(‘‘,{‘alt’:’logo-7at7′,’src’:’https://res.cloudinary.com/review-journal/image/upload/f_auto,q_auto,c_scale,w_50/v1611100661/webdev/seven2.png’})
).append(
$(‘‘,{‘html’:’ — now streaming’})
)
);
var f_desc = $(”,{‘class’:’f-desc’,’html’:description})
var pScript = document.createElement(“script”);
pScript.type = ‘text/javascript’;
pScript.src = ‘https://fuel-streaming-prod01.fuelmedia.io/player/1.0/player.min.js’;
pScript.async = true;
pScript.setAttribute(‘id’, ‘fuel-player-script’);
elem.addClass(‘rj-fuel-77’);
elem.append(pHtml);
elem.append(f_title);
elem.append(f_desc);
elem.append(pScript);
}
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(‘rj_xhr.status:’ + xhr.status + ‘_error:’ + thrownError);
}
});
},
videoIDs: {
‘category-local’: {‘id’: ‘7395798e-4c30-417b-8b1a-b3d7bad8ff98’, ‘provider’:’fuel’},
‘tag-coronavirus’: {‘id’: ‘u37v495p’},
‘category-politics-and-government’: {‘id’: ‘kqRvD0a8’},
‘tag-mc-opinion’: {‘id’: ‘kqRvD0a8’},
‘tag-mc-crime’: {‘id’: ‘kqRvD0a8’},
‘tag-2020-election’: {‘id’: ‘kqRvD0a8’},
‘rj-main-category–science-and-technology’: {‘id’: ‘j88hQyle’},
‘tag-mc-news’: {‘id’: ‘pCyFtg5f’},
‘tag-mc-business’: {‘id’: ’31shkzyP’},
‘rj-main-category–raiders’: {‘id’: ‘bpswZwKM’},
‘tag-mc-sports’: {‘id’: ‘dbx2WkwF’},
‘rj-main-category–food’: {‘id’: ‘3DQjoZb7’},
‘tag-mc-entertainment’: {‘id’: ‘YBuF2XdP’},
‘tag-mc-life’: {‘id’: ‘aaWqdJ5u’},
‘tag-mc-autos’: {‘id’: ‘kag2nBSV’},
‘tag-mc-homes’: {‘id’: ‘HPa6ehMQ’}
},
getVideoId: function() {
//var fkId = false,
var vdo_k = false;
for (var checkClass in stnInArticleVideo.videoIDs) {
if (stnInArticleVideo.wrapper.hasClass(checkClass)) {
//fkId = videoIDs[checkClass].id;
vdo_k = checkClass;
break;
}
}
return vdo_k; //fkId;
},
run: function() {
stnInArticleVideo.wrapper = $(‘article.rj-story.rj-story-full’);
if (stnInArticleVideo.wrapper && stnInArticleVideo.canInsertVideo()) {
var vdo_k = stnInArticleVideo.getVideoId();
if (vdo_k) {
if (stnInArticleVideo.videoIDs[vdo_k].hasOwnProperty(‘provider’) && stnInArticleVideo.videoIDs[vdo_k].provider == ‘fuel’) {
stnInArticleVideo.insertVideoFuel(stnInArticleVideo.videoIDs[vdo_k].id);
} else {
stnInArticleVideo.insertVideo(stnInArticleVideo.videoIDs[vdo_k].id);
}
}
}
}
};
stnInArticleVideo.run();
});
})(jQuery);