From d369c1654022d946a5adfc876a15e6feb4607313 Mon Sep 17 00:00:00 2001 From: Sanjay Bhangar Date: Thu, 6 Dec 2018 17:08:12 +0200 Subject: [PATCH] add util to fetch video thumb / video --- src/config.js | 4 +++- src/utils/video.js | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/utils/video.js diff --git a/src/config.js b/src/config.js index c4a8fff..f5c9894 100644 --- a/src/config.js +++ b/src/config.js @@ -1,3 +1,5 @@ export default { - apiUrl: 'https://858.ma/api' + baseUrl: 'https://858.ma', + videoBase: 'https://video22.858.ma', + apiUrl: 'https://858.ma/api' }; \ No newline at end of file diff --git a/src/utils/video.js b/src/utils/video.js new file mode 100644 index 0000000..f677cef --- /dev/null +++ b/src/utils/video.js @@ -0,0 +1,9 @@ +import config from '../config'; + +export function getThumbnail(id, size='256') { + return `${config.baseUrl}/${id}/icon${size}.jpg` +} + +export function getVideo(id, size='480') { + return `${config.videoBase}/${id}/${size}.mp4`; +} \ No newline at end of file