[Improve flowplayer-component clinton@unknownlamer.org**20080213224305 * A few more config settings are support * A simple skin configuration option has been added * Configuration is now injected via js to work around a bug in the JSON parser with URLs containing ampersands * video-width was renamed player-width as that is what it really is ] { hunk ./src/flowplayer.lisp 14 - (playlist :initarg :playlist :accessor playlist :initform nil) hunk ./src/flowplayer.lisp 15 + (auto-buffer :initarg :auto-buffer :accessor auto-buffer-p :initform t) hunk ./src/flowplayer.lisp 21 - (video-width :initarg :video-width :accessor video-width - :initform *flowplayer-default-controls-width*))) + (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))) + hunk ./src/flowplayer.lisp 46 - (video-width self))) + (player-width self)) + (player-width self)) hunk ./src/flowplayer.lisp 51 + (player-config-var (gensym "fo")) hunk ./src/flowplayer.lisp 55 - (new (*s-w-f-object "/static/flash/FlowPlayer.swf" - ,player-id - ,(format nil "~D" (video-width self)) - ,(format nil "~D" - (+ +flowplayer-controls-height+ - (video-height self))) - "7" - "#ffffff" - t))) - `(.add-variable - ,player-var - "config" - ;; swfobject parses the proplist manually and requires a space - ;; between proplist entries, and so using .toSource or just - ;; passing a proplist object does not work - ,(js:js* `(create - :video-height ,(video-height self) - :play-list (array ,@(mapcar (lambda (entry) - `(create ,@entry)) - (playlist self))) - :full-screen-script-u-r-l "/static/js/fullscreen.js" - :auto-play ,(if (auto-play-p self) 'true 'false) - :loop ,(if (loop-clips-p self) 'true 'false) - :hide-controls ,(if (hide-controls-p self) 'true 'false)))) + (new (*s-w-f-object "/static/flash/FlowPlayer.swf" + ,player-id + ,(format nil "~D" (player-width self)) + ,(format nil "~D" + (+ +flowplayer-controls-height+ + (video-height self))) + "7" + "#ffffff" + t))) + `(.add-variable ,player-var + "config" + ,(js:js* `(create :config-inject t))) + `(defvar ,player-config-var + (create + :video-height ,(video-height self) + :play-list (array ,@(mapcar (lambda (entry) + `(create ,@entry)) + (playlist self))) + :full-screen-script-u-r-l "/static/js/fullscreen.js" + :auto-play ,(if (auto-play-p self) 'true 'false) + :auto-buffering ,(if (auto-buffer-p self) 'true 'false) + :loop ,(if (loop-clips-p self) 'true 'false) + :hide-controls ,(if (hide-controls-p self) 'true 'false) + ,@(mapcan (lambda (config-entry) + (list (car config-entry) + (if-bind value (cdr config-entry) + value + 'false))) + (skin-configuration self)))) + `(dojo.event.connect window + "onload" + (lambda () + (let ((fp (.get-element-by-id document ,player-id))) + (.set-config fp ,player-config-var)))) hunk ./src/flowplayer.lisp 91 - }