diff --git a/src/computersandblues/lodestone/app.cljs b/src/computersandblues/lodestone/app.cljs index 42b54e8..1671a3c 100644 --- a/src/computersandblues/lodestone/app.cljs +++ b/src/computersandblues/lodestone/app.cljs @@ -358,9 +358,12 @@ "video" [:video {:controls true} [:source {:type (str "video/" ext) :src remote-url}] [:a {:href (:remote_url attachment)} (str "Original video at " (:remote_url attachment))]] - "gifv" [:video {:loop true :autoplay true :muted true} - [:source {:type (str "video/" ext) :src remote-url}] - [:a {:href (:remote_url attachment)} (str "Original video at " (:remote_url attachment))]] + "gifv" (let [autoplay (r/atom false) + toggle-autoplay #(swap! autoplay not)] + (fn [] + [:video {:loop true :autoplay @autoplay :muted true :on-pointer-enter toggle-autoplay} + [:source {:type (str "video/" ext) :src remote-url}] + [:a {:href (:remote_url attachment)} (str "Original video at " (:remote_url attachment))]])) [:div [:strong "Unsupported attachment"] [debug attachment]])))