Skip to content

Commit c808b96

Browse files
committed
Merge branch 'fix-video-file'
2 parents 2671bd4 + eba682a commit c808b96

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/resources/views/crud/fields/video.blade.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,21 @@
163163
url: null
164164
};
165165
166-
$.getJSON(api, function( data ){
167-
168-
if (typeof(data.items[0]) != "undefined") {
169-
var v = data.items[0].snippet;
170-
171-
video.id = videoId;
172-
video.title = v.title;
173-
video.image = v.thumbnails.maxres ? v.thumbnails.maxres.url : v.thumbnails.default.url;
174-
video.url = 'https://www.youtube.com/watch?v=' + video.id;
175-
176-
callback(video);
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+
}
177181
}
178182
});
179183
};

0 commit comments

Comments
 (0)