File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
src/resources/views/crud/fields Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 163163 url: null
164164 };
165165
166- $ .getJSON (api, function ( data ){
166+ $ .ajax ({
167+ dataType: " jsonp" ,
168+ url: api,
169+ crossDomain: true ,
170+ success : function (data ) {
171+ if (typeof (data .items [0 ]) != " undefined" ) {
172+ var v = data .items [0 ].snippet ;
173+
174+ video .id = videoId;
175+ video .title = v .title ;
176+ video .image = v .thumbnails .maxres ? v .thumbnails .maxres .url : v .thumbnails .default .url ;
177+ video .url = ' https://www.youtube.com/watch?v=' + video .id ;
178+
179+ callback (video);
180+ }
181+ }
182+ });
183+ };
184+
185+ /* $.getJSON(api, function( data ){
167186
168187 if (typeof(data.items[0]) != "undefined") {
169188 var v = data.items[0].snippet;
176195 callback(video);
177196 }
178197 });
179- };
198+ }; */
180199
181200 var fetchVimeo = function ( videoId , callback ){
182201
You can’t perform that action at this time.
0 commit comments