(in-package :com.tee-it-up-golf.web) (defconstant +flowplayer-controls-height+ 28 "Height in pixels of the flowplayer controls") (defvar *flowplayer-default-controls-width* 468 "Default Width in pixels of flowplayer controls.") (defvar *flowplayer-default-video-height* 300 "Default height in pixels of the flowplayer video screen") (defcomponent flowplayer-component (html-block-element-mixin) ((auto-play :initarg :auto-play :accessor auto-play-p :initform nil) (auto-buffer :initarg :auto-buffer :accessor auto-buffer-p :initform t) (loop-clips :initarg :loop-clips :accessor loop-clips-p :initform t) (hide-controls :initarg :hide-controls :accessor hide-controls-p :initform nil) (video-height :initarg :video-height :accessor video-height :initform *flowplayer-default-video-height*) (player-width :initarg :player-width :accessor player-width :initform *flowplayer-default-controls-width*) (skin-config :initarg :skin-config :accessor skin-configuration :initform nil :documentation "List of (:skin-option . value) pairs to be inserted into the player skin configuration. Valid options are the parenscriptified names in the flowplayer skin documentation. In addition if nil is specified for a value it is properly converted a javascript false.") (playlist :initarg :playlist :accessor playlist :initform nil)) (:default-initargs :dom-id (ps:ps-gensym "flowplayer"))) (defmethod render ((self flowplayer-component)) (<:div :id (html-element.dom-id self) (<:p (let ((player-id (ps:ps-gensym "fbp"))) (<:object :id player-id :declare "declare" :data (action-href (register-action (:with-call/cc t) (call-as-window 'fallback-playlist :playlist (playlist self)))) :style (format nil "height: ~Dpx; width: ~Dpx;" (+ +flowplayer-controls-height+ (video-height self)) (player-width self)) (player-width self)) (<:a :href (format nil "#~A" player-id) (<:as-html "Play"))))) (<:script :src "/static/js/swfobject.js") (let ((player-var (gensym "fo")) (player-config-var (gensym "fo")) (player-id (ps:ps-gensym "fbp"))) (