module Panda.View.Atom.Video where
import Panda.Helper.Env hiding (name, id)
import Panda.Model.Video
import qualified Panda.Config.Global as G
import Panda.Helper.Html
instance DataRenderer Video where
render_data = show_video
show_video x = case x.video_type of
MediaPlayer -> show_media_player x
show_media_player x =
[ p ! [id l] << "The player will show in this paragraph"
, tag "script" ! [thetype "text/javascript"] << primHtml ( play (x.uid) (x.preview) (x.uid) )
] .toHtml
where l = x.uid
play i p x =
[ "var s1 = new SWFObject('/flash/player.swf','player','400','348','9');"
, "s1.addParam('allowfullscreen','true');"
, "s1.addParam('allowscriptaccess','always');"
, "s1.addParam('flashvars','file=" ++ x ++ "&image=" ++ p ++ "');"
, "s1.write('" ++ i ++ "');"
]
.join "\n"