podlove-web-player-rails 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ module Podlove
2
2
  module Web
3
3
  module Player
4
4
  module Rails
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
8
8
  end
@@ -14,19 +14,21 @@ module Podlove
14
14
  private
15
15
 
16
16
  def podlove(type, options = {})
17
- html = "<#{type} id='player'>"
17
+ id = "player_" + SecureRandom.hex(5)
18
+
19
+ html = "<#{type} id='#{id}'>"
18
20
  html << "<source src='#{options[:src]}'"\
19
21
  "" + (options[:type] ? " type='#{options[:type]}'" : "") + "></source>" if options[:src]
20
22
  html << "<source src='#{options[:mp4]}' type='#{type}/mp4'></source>" if options[:mp4]
21
23
  html << "<source src='#{options[:mp3]}' type='#{type}/mpeg'></source>" if options[:mp3]
22
24
  html << "<source src='#{options[:ogg]}' type='#{type}/ogg; codecs=vorbis'></source>" if options[:ogg]
23
25
  html << "<source src='#{options[:opus]}' type='#{type}/ogg; codecs=opus'></source>" if options[:opus]
24
- html << "<source src='#{options[:opus]}' type='#{type}/webm'></source>" if options[:webm]
26
+ html << "<source src='#{options[:webm]}' type='#{type}/webm'></source>" if options[:webm]
25
27
  html << "</#{type}>"
26
28
 
27
29
  [:src, :type, :mp4, :mp3, :ogg, :opus, :webm].each{ |key| options.delete(key) }
28
30
 
29
- script = "$('#player').podlovewebplayer(#{options.to_json});"
31
+ script = "$('##{id}').podlovewebplayer(#{options.to_json});"
30
32
 
31
33
  return raw html + "\n" + javascript_tag(script)
32
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podlove-web-player-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-14 00:00:00.000000000 Z
12
+ date: 2013-05-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -111,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  segments:
113
113
  - 0
114
- hash: -3191162096910017911
114
+ hash: -423875662606043562
115
115
  required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  segments:
122
122
  - 0
123
- hash: -3191162096910017911
123
+ hash: -423875662606043562
124
124
  requirements: []
125
125
  rubyforge_project:
126
126
  rubygems_version: 1.8.24