From a39a483f4d0b489100dddec1b6a44c5b2253d5dd Mon Sep 17 00:00:00 2001 From: Felipe Leon Date: Wed, 3 Aug 2022 19:55:18 -0300 Subject: [PATCH] Update vod previw url fun --- app/specific/PlayVod.js | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/app/specific/PlayVod.js b/app/specific/PlayVod.js index 15b9dbddf..14b784770 100644 --- a/app/specific/PlayVod.js +++ b/app/specific/PlayVod.js @@ -164,6 +164,7 @@ function PlayVod_Start() { function PlayVod_SetStart() { PlayVod_muted_segments_value = null; PlayVod_previews_clear(); + PlayVod_get_preview_Url(); PlayVod_updateStreamLogo(); PlayVod_updateChapters(); @@ -303,8 +304,6 @@ function PlayVod_updateVodInfoPannel(response, key, ID) { Play_CheckFollow(Main_values.Main_selectedChannel_id); - //TODO update this - PlayVod_previews_pre_start(null); PlayVod_muted_segments_value = response.muted_segments; PlayVod_muted_segments(PlayVod_muted_segments_value); @@ -1357,6 +1356,33 @@ function PlayVod_FastBackForward(position) { PlayVod_setHidePanel(); } +var previewUrl = '{"query":"{video(id:%x){seekPreviewsURL}}"}'; + +function PlayVod_get_preview_Url() { + FullxmlHttpGet( + PlayClip_BaseUrl, + Play_base_backup_headers_Array, + PlayVod_get_preview_UrlResult, + noop_fun, + 0, + PlayClip_loadVodOffsetStartVodId, + 'POST', //Method, null for get + previewUrl.replace('%x', Main_values.ChannelVod_vodId) + ); +} + +function PlayVod_get_preview_UrlResult(responseObj) { + if (PlayVod_isOn) { + if (responseObj.status === 200) { + var obj = JSON.parse(responseObj.responseText); + + if (obj.data && obj.data.video && obj.data.video.seekPreviewsURL) { + PlayVod_previews_pre_start(obj.data.video.seekPreviewsURL); + } + } + } +} + var PlayVod_previews_url; var PlayVod_previewsId;