Skip to content

Commit

Permalink
Merge pull request #175 from BuildFire/enhance-thumbnail-quality
Browse files Browse the repository at this point in the history
fix(pixelation in layout 3) : use standard url for thubmnail
  • Loading branch information
mas-iota authored Jul 21, 2024
2 parents 5252068 + f531998 commit c0ecadd
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions widget/controllers/widget.feed.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,14 +513,23 @@
}, 300);
});

WidgetFeed.getThumbnail = function(video) {
var isTablet = $rootScope.deviceWidth >= 768;
if (isTablet) {
return video.snippet.thumbnails.maxres.url;
} else {
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 c0ecadd

Please sign in to comment.