From f69a1e82d69ae697b630ab5b22fa59eaefde5540 Mon Sep 17 00:00:00 2001 From: j-bitmaker Date: Tue, 9 May 2023 12:16:07 +0300 Subject: [PATCH 1/2] feat: show video caption in tab --- components/lenta/index.js | 13 +++++++++++++ components/post/index.js | 7 +++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/components/lenta/index.js b/components/lenta/index.js index 2291a1eb62..836f144571 100644 --- a/components/lenta/index.js +++ b/components/lenta/index.js @@ -936,6 +936,7 @@ var lenta = (function(){ if(!vel.length) return + if (shadow && !players[share.txid]){ players[share.txid] = { @@ -1601,6 +1602,8 @@ var lenta = (function(){ actions.initVideo(share, function(res){ + document.title = share.caption; + fullscreenvideoShowing = null if(!res){ @@ -2138,6 +2141,8 @@ var lenta = (function(){ stopPlayer : function(id){ + document.title = 'Bastyon'; + var player = players[id] if(!player || player.error) return @@ -2370,6 +2375,8 @@ var lenta = (function(){ _.each(players, function(player){ + document.title = 'Bastyon'; + if (player.error) return // player.p.muted = true; @@ -4925,6 +4932,9 @@ var lenta = (function(){ if(!essenseData.txids){ self.app.platform.matrixchat.clbks.SHOWING.lenta = function(v){ + + document.title = 'Bastyon'; + if(v){ _.each(players, function(player){ if (player.error || !player.p) return @@ -5492,6 +5502,9 @@ var lenta = (function(){ }, destroy : function(){ + + document.title = "Bastyon"; + initialized = null delete self.app.events.delayedscroll['videos' + mid] diff --git a/components/post/index.js b/components/post/index.js index eb2900bbc3..e7cdb9a1cd 100644 --- a/components/post/index.js +++ b/components/post/index.js @@ -496,7 +496,7 @@ var post = (function () { self.closeContainer() var startTime = player && player.getPosition ? player.getPosition() : 0 - + setTimeout(function(){ self.app.platform.ui.pipvideo(share.txid, null, { startTime @@ -1920,8 +1920,10 @@ var post = (function () { renders.comments(function () { }) - if (share.itisvideo()) + if (share.itisvideo()){ actions.changeSavingStatusLight(share); + document.title = share.caption; + } if (share.itisvideo() && !ed.repost && !p.pip && recommendationsenabled && !_OpenApi && !ed.openapi) { @@ -2035,6 +2037,7 @@ var post = (function () { destroy: function (key) { + document.title = 'Bastyon'; if (external){ external.destroy() From 62a138436c8fb913ee542eb567fbf9edc01081b6 Mon Sep 17 00:00:00 2001 From: j-bitmaker Date: Tue, 9 May 2023 12:24:38 +0300 Subject: [PATCH 2/2] +if --- components/lenta/index.js | 5 ++++- components/post/index.js | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/components/lenta/index.js b/components/lenta/index.js index 836f144571..28a9569183 100644 --- a/components/lenta/index.js +++ b/components/lenta/index.js @@ -1602,7 +1602,10 @@ var lenta = (function(){ actions.initVideo(share, function(res){ - document.title = share.caption; + if (share.caption){ + document.title = share.caption; + } + fullscreenvideoShowing = null diff --git a/components/post/index.js b/components/post/index.js index e7cdb9a1cd..7ae9b45af1 100644 --- a/components/post/index.js +++ b/components/post/index.js @@ -496,7 +496,7 @@ var post = (function () { self.closeContainer() var startTime = player && player.getPosition ? player.getPosition() : 0 - + setTimeout(function(){ self.app.platform.ui.pipvideo(share.txid, null, { startTime @@ -1922,7 +1922,10 @@ var post = (function () { if (share.itisvideo()){ actions.changeSavingStatusLight(share); - document.title = share.caption; + + if (share.caption){ + document.title = share.caption; + } } if (share.itisvideo() && !ed.repost && !p.pip && recommendationsenabled && !_OpenApi && !ed.openapi) {