我目前正在使用 jQuery.tubular ( Here ) 在后台显示 YT 视频,其中 ID 是使用 YouTube 数据 API 获取的。Tubular 加载,但没有加载我要求它的视频,无论出于何种原因。这是相关的JS:
var output;
$(document).ready(function() {
getURLPs(); //parses url params into an array, this works
$('#content').hide().delay(7000).fadeIn('slow');
console.log('ID: '+urlParams["id"]);
console.log('Title: '+urlParams["title"]);
tubularoptions = '{videoId: \''+urlParams["id"]+'\'}';
console.log('Passing \"'+tubularoptions+'\" to jQuery.tubular.');
$('#wrapper').tubular(tubularoptions);
output = '<span class=\"animlink\"><a href=\"http://www.youtube.com/watch?v='+urlParams["id"]+'\">'+urlParams["title"]+'</a></span>';
$('#nowplaying-text').append(output);
$('#preloader').delay(1000).fadeOut('slow',function(){$(this).remove();});
});
控制台读取以下内容:
ID: G15btlaZR_k
Title: Ryos ft. Allisa Rose - Eclipse
Passing "{videoId: 'G15btlaZR_k'}" to jQuery.tubular.
但随后管状加载默认视频。一切看起来都应该有效,但事实并非如此。有什么线索吗?