Skip to content

Commit

Permalink
Bugfix in default transform and version bump.
Browse files Browse the repository at this point in the history
Handle cases where images.poster or images.thumbnail does not exist.

	modified:   lib/default-video-transform.js
	modified:   package.json
  • Loading branch information
kixxauth committed Feb 9, 2017
1 parent 9d74263 commit 8ad0e8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions lib/default-video-transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ const TYPE_MATCHER = /application\/x-mpegURL/;
const formatImages = video => {
const images = [];

video.images.poster.sources
const videoImages = {
poster: video.images.poster || [],
thumbnail: video.images.thumbnail || []
};

videoImages.poster.sources
.filter(image => {
return HTTPS_MATCHER.test(image.src);
})
Expand All @@ -20,7 +25,7 @@ const formatImages = video => {
});
});

video.images.thumbnail.sources
videoImages.thumbnail.sources
.filter(image => {
return HTTPS_MATCHER.test(image.src);
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oddworks-brightcove-provider",
"version": "1.3.3",
"version": "1.3.4",
"description": "An Oddworks provider plugin for Brightcove APIs",
"main": "index.js",
"dependencies": {
Expand Down

0 comments on commit 8ad0e8c

Please sign in to comment.