@@ -184,14 +184,8 @@ var youmax_global_options = {};
184184 var channelId = channelData . id ;
185185 var channelName = channelData . snippet . title ;
186186 var channelPic = channelData . snippet . thumbnails . default . url ;
187- var channelSubscribers = channelData . statistics . subscriberCount ;
188- var channelViews = channelData . statistics . viewCount ;
189- var channelDesc = "" ;
190187 var channelUploadsPlaylistId = channelData . contentDetails . relatedPlaylists . uploads ;
191188
192-
193-
194-
195189 $ ( '#youmax-header' ) . append ( '<a href="' + youTubeChannelURL + '" target="_blank"><img id="youmax-header-logo" src="' + channelPic + '"/>' + channelName + '</a>' ) ;
196190
197191 $ ( '#youmax-header' ) . append ( '<div class="youmax-subscribe"><div class="g-ytsubscribe" data-channelid="' + channelId + '" data-layout="default" data-count="default"></div></div>' ) ;
@@ -366,54 +360,8 @@ var youmax_global_options = {};
366360 $ ( 'html,body' ) . animate ( { scrollTop : $ ( "#youmax-video" ) . offset ( ) . top } , 'fast' ) ;
367361 }
368362 } ) ;
369- getVideoStats ( videoIdArray ) ;
370- } ,
371-
372-
373- //get video stats using Youtube API
374- getVideoStats = function ( videoIdList ) {
375- //console.log('inside getVideoStats');
376- //console.log(videoIdList);
377- //showLoader();
378-
379- apiVideoStatURL = "https://www.googleapis.com/youtube/v3/videos?part=statistics%2CcontentDetails&id=" + videoIdList + "&key=" + youmax_global_options . apiKey ;
380- $ . ajax ( {
381- url : apiVideoStatURL ,
382- type : "GET" ,
383- async : true ,
384- cache : true ,
385- dataType : 'jsonp' ,
386- success : function ( response ) { displayVideoStats ( response ) ; } ,
387- error : function ( html ) { alert ( html ) ; } ,
388- beforeSend : setHeader
389- } ) ;
390- } ,
391-
392- //display video statistics
393- displayVideoStats = function ( response ) {
394- //console.log(response);
395-
396- var videoArray = response . items ;
397- var $videoThumbnail ;
398-
399- for ( var i = 0 ; i < videoArray . length ; i ++ ) {
400- videoId = videoArray [ i ] . id ;
401- videoViewCount = videoArray [ i ] . statistics . viewCount ;
402- videoViewCount = getReadableNumber ( videoViewCount ) ;
403- videoDuration = videoArray [ i ] . contentDetails . duration ;
404- //console.log('videoDuration-'+videoDuration);
405-
406- videoDuration = convertDuration ( videoDuration ) ;
407- videoDefinition = videoArray [ i ] . contentDetails . definition . toUpperCase ( ) ;
408- $videoThumbnail = $ ( '#youmax-video-list-div #' + videoId ) ;
409- $videoThumbnail . find ( '.youmax-video-list-views' ) . prepend ( videoViewCount + ' views | ' ) ;
410- $videoThumbnail . find ( '.youmax-duration' ) . append ( videoDuration ) ;
411- //$videoThumbnail.append('<div class="youmax-definition">'+videoDefinition+'</div>');
412-
413- }
414363 } ,
415364
416-
417365 getUploads = function ( youmaxTabId , playlistTitle , nextPageToken ) {
418366 //showLoader();
419367 //var apiUploadURL = "http://gdata.youtube.com/feeds/api/users/"+youmaxUser+"/uploads/?v=2&alt=jsonc&max-results=50";
0 commit comments