Skip to content

Commit 3913a83

Browse files
author
Bastian Bartmann
committed
added podlovevideo view helper
1 parent be7b4f5 commit 3913a83

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/podlove-web-player-rails/view_helpers.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ def podloveaudio(options = {})
1515

1616
return raw html + "\n" + javascript_tag(script)
1717
end
18+
19+
def podlovevideo(options = {})
20+
html = "<video id='player'>"
21+
html << "<source src='#{options[:src]}' type='#{options[:type]}'></source>"
22+
html << "</video>"
23+
24+
options.delete(:src)
25+
options.delete(:type)
26+
27+
script = "$('#player').podlovewebplayer(#{options.to_json});"
28+
29+
return raw html + "\n" + javascript_tag(script)
30+
end
1831
end
1932
end
2033
end

0 commit comments

Comments
 (0)