Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
AliAlaqrabawi3 committed Jul 17, 2024
1 parent 8917b57 commit 4657c48
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions widget/controllers/widget.feed.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,19 +513,23 @@
}, 300);
});

WidgetFeed.getThumbnail = function(video) {
var isTablet = $rootScope.deviceWidth >= 768;
const layoutName = WidgetFeed.data.design.itemListLayout
const { maxres, standard, high ,medium } = video.snippet.thumbnails;
if (isTablet) {
return maxres?.url || standard?.url || high?.url || medium?.url;
}
if (layoutName === "List_Layout_3") {
return standard?.url || high?.url || medium?.url;
}
return video.snippet.thumbnails.medium.url;

};
WidgetFeed.getThumbnail = function(video) {
var isTablet = $rootScope.deviceWidth >= 768;
const layoutName = WidgetFeed.data.design.itemListLayout;
const thumbnails = video.snippet.thumbnails;
const maxres = thumbnails.maxres ? thumbnails.maxres.url : null;
const standard = thumbnails.standard ? thumbnails.standard.url : null;
const high = thumbnails.high ? thumbnails.high.url : null;
const medium = thumbnails.medium ? thumbnails.medium.url : null;

if (isTablet) {
return maxres || standard || high || medium;
}
if (layoutName === "List_Layout_3") {
return standard || high || medium;
}
return medium;
};

WidgetFeed.bookmark = function($event, video) {
$event.stopImmediatePropagation();
Expand Down

0 comments on commit 4657c48

Please sign in to comment.