File tree Expand file tree Collapse file tree 2 files changed +9
-14
lines changed
lib/podlove-web-player-rails Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -4,22 +4,19 @@ module Player
44 module Rails
55 module ViewHelpers
66 def podloveaudio ( options = { } )
7- html = "<audio id='player'>"
8- html << "<source src='#{ options [ :src ] } ' type='#{ options [ :type ] } '></source>"
9- html << "</audio>"
10-
11- options . delete ( :src )
12- options . delete ( :type )
13-
14- script = "$('#player').podlovewebplayer(#{ options . to_json } );"
15-
16- return raw html + "\n " + javascript_tag ( script )
7+ podlove ( "audio" , options )
178 end
189
1910 def podlovevideo ( options = { } )
20- html = "<video id='player'>"
11+ podlove ( "video" , options )
12+ end
13+
14+ private
15+
16+ def podlove ( type , options = { } )
17+ html = "<#{ type } id='player'>"
2118 html << "<source src='#{ options [ :src ] } ' type='#{ options [ :type ] } '></source>"
22- html << "</video >"
19+ html << "</audio >"
2320
2421 options . delete ( :src )
2522 options . delete ( :type )
Original file line number Diff line number Diff line change 1- gem 'railties' , '>= 3.0.0'
21require 'action_controller/railtie'
32require 'rails/test_unit/railtie'
4-
53require 'podlove-web-player-rails'
64require 'coveralls'
75Coveralls . wear!
You can’t perform that action at this time.
0 commit comments