mirror of
https://github.com/logseq/logseq.git
synced 2026-04-30 08:56:29 +00:00
fix: set aspect ratio for youtube video player
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
url (if start
|
||||
(str url "&start=" start)
|
||||
url)]
|
||||
[:iframe
|
||||
[:iframe.aspect-video
|
||||
{:id (str "youtube-player-" id)
|
||||
:allow-full-screen "allowfullscreen"
|
||||
:allow "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope"
|
||||
@@ -99,7 +99,6 @@
|
||||
id (str/replace-first id #"youtube-player-" "")]
|
||||
(get (get @state/state :youtube/players) id))))
|
||||
|
||||
|
||||
(rum/defc timestamp
|
||||
[seconds]
|
||||
[:a.svg-small.youtube-timestamp
|
||||
@@ -121,7 +120,6 @@ Remember: You can paste a raw YouTube url as embedded video on mobile."
|
||||
false)
|
||||
nil)))
|
||||
|
||||
|
||||
(defn parse-timestamp [timestamp']
|
||||
(let [reg #"^(?:(\d+):)?([0-5]?\d):([0-5]?\d)$"
|
||||
reg-number #"^\d+$"
|
||||
@@ -145,13 +143,13 @@ Remember: You can paste a raw YouTube url as embedded video on mobile."
|
||||
(re-matches #"^(?:(\d+):)?([0-5]?\d):([0-5]?\d)$" "123:22:23") ;; => ["123:22:23" "123" "22" "23"]
|
||||
(re-matches #"^(?:(\d+):)?([0-5]?\d):([0-5]?\d)$" "30:23") ;; => ["30:23" nil "30" "23"]
|
||||
|
||||
(parse-timestamp "01:23") ;; => 83
|
||||
(parse-timestamp "01:23") ;; => 83
|
||||
|
||||
(parse-timestamp "01:01:23") ;; => 3683
|
||||
(parse-timestamp "01:01:23") ;; => 3683
|
||||
|
||||
;; seconds->display
|
||||
;; https://stackoverflow.com/questions/1322732/convert-seconds-to-hh-mm-ss-with-javascript
|
||||
(seconds->display 129600) ;; => "36:00:00"
|
||||
(seconds->display 13545) ;; => "03:45:45"
|
||||
(seconds->display 18) ;; => "00:18"
|
||||
)
|
||||
(seconds->display 129600) ;; => "36:00:00"
|
||||
(seconds->display 13545) ;; => "03:45:45"
|
||||
(seconds->display 18) ;; => "00:18"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user