module Admin module VideosHelper def display_video_size(video) main_source = video.sources.first number_to_human_size main_source.video_file_size if main_source end def display_video(video, width=nil, height=nil) return unless video main_source = video.sources.first if main_source.nil? html = "
#{t('videos.no_source')}
" return html end width = width ? width : main_source.width height = height ? height : main_source.height poster = main_source.video.url(:poster, false) flash_player = 'http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf' video_alt = 'Poster image' poster_title = video.title sources = video.sources.map do |source| { :src => "http://localhost:3000#{source.video.url(:original, false)}", :type => "#{source.video_content_type}" } end html = "" html << "