Created
March 21, 2016 17:38
-
-
Save shofetim/b7ee7bf902e573827fe3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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