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
4
4
module Rails
5
5
module ViewHelpers
6
6
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 )
17
8
end
18
9
19
10
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'>"
21
18
html << "<source src='#{ options [ :src ] } ' type='#{ options [ :type ] } '></source>"
22
- html << "</video >"
19
+ html << "</audio >"
23
20
24
21
options . delete ( :src )
25
22
options . delete ( :type )
Original file line number Diff line number Diff line change 1
- gem 'railties' , '>= 3.0.0'
2
1
require 'action_controller/railtie'
3
2
require 'rails/test_unit/railtie'
4
-
5
3
require 'podlove-web-player-rails'
6
4
require 'coveralls'
7
5
Coveralls . wear!
You can’t perform that action at this time.
0 commit comments