From 3f1913e5f4c1def04ed05c269d086b8775f01211 Mon Sep 17 00:00:00 2001 From: infiinte-persistence Date: Wed, 9 Dec 2020 22:32:42 +0800 Subject: [PATCH] Handle timestamp in Markdown. The videojs player is exposed through the 'window' object. --- CHANGELOG.md | 10 ++++++++ ui/component/markdownLink/view.jsx | 25 ++++++++++++++++--- .../viewers/videoViewer/internal/videojs.jsx | 3 +++ 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8e2475b0..98681f7a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added +- Turn timestamps in a video's description and comments into links _community pr!_ ([#5156](https://github.com/lbryio/lbry-desktop/pull/5156)) + +### Changed + +### Fixed + +## [0.49.0] - [2020-12-10] + +### Added + - Better search suggestions ([#5124](https://github.com/lbryio/lbry-desktop/pull/5124)) - Inline video player in comments/markdown posts ([#4894](https://github.com/lbryio/lbry-desktop/pull/4894)) - Better handling of winning claim + top page improvements ([#4944](https://github.com/lbryio/lbry-desktop/pull/4944)) diff --git a/ui/component/markdownLink/view.jsx b/ui/component/markdownLink/view.jsx index 130d273e5..2f0ab6986 100644 --- a/ui/component/markdownLink/view.jsx +++ b/ui/component/markdownLink/view.jsx @@ -62,10 +62,27 @@ function MarkdownLink(props: Props) { } } - // Return plain text if no valid url - // Return external link if protocol is http or https - // Return local link if protocol is lbry uri - if (!simpleLinks && ((protocol && protocol[0] === 'lbry:' && isURIValid(decodedUri)) || lbryUrlFromLink)) { + if (href.startsWith('?t=')) { + // Video timestamp markers + element = ( +