Skip to content

Instantly share code, notes, and snippets.

@shofetim
Created March 21, 2016 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shofetim/b7ee7bf902e573827fe3 to your computer and use it in GitHub Desktop.
Save shofetim/b7ee7bf902e573827fe3 to your computer and use it in GitHub Desktop.
(ns fb.admin
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [om.core :as om :include-macros true]
[om-tools.dom :as dom :include-macros true]))
(defn play []
(print "play clicked"))
(defn pause []
(print "pause clicked"))
(defcomponent video [data owner]
(did-mount [_]
;; No idea why regular, on element events don't fire, but after
;; much testing, they just dont.
(let [video (. js/document (getElementById "video"))]
(set! (.-onplay video) #(play))
(set! (.-onpause video) #(pause))))
(render [_]
(let [name (get-in data [:view :route-params :entity] "pages")]
(dom/div {:class "background"}
(dom/div {:class "container-fluid admin"}
(dom/div {:class "row"}
(dom/div {:class "col-xs-12"}
(dom/video {:src "video-url-goes-here"
:id "video" :controls true :preload true}))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment