podlove-web-player-rails 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzViNTFjZWNiMWUzMTlmOGNkZjRlNWRhMjA1MDU3YzE0MzIxOTY5Mg==
4
+ ZmQ0OTA1MzQ2MmZiOTEwMWFkNjE5YjI1N2MyMGFlMzk0ZGFjNGI4Mg==
5
5
  data.tar.gz: !binary |-
6
- MDVhZTQxNjdkMjUwNTExMThhZWJiMTY3ODFhYjc1YTgzNjlhNzc1Yw==
6
+ YzNmMjViNDE0Yzk0NWQ2MWU2MGFhNDVlNjNmMzk2NjM4ZjVkNGEyNQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MzVkOGM4NjNkMDYwMjM4Y2JkZmQ2Yjg4M2UwN2Y3Y2NlYTVlMzdlYjljZjY5
10
- YWJiMDdlN2Y4YmY5ZTA2NGRhNGViZjQ3NTkwYTI3NzUyNWQ3YTMxYTNhNzMy
11
- MDNlODQyMGY3MmZjYzM2NDU2ZmE5YzNjMzRhYzJlNTM3MDVlNWQ=
9
+ OWEzZWQwYTI1YzdjMzVmNjg2YWQyMGRiYjk5NTRjMGM1NzMyMmVhN2VmNzg3
10
+ NTM2NzFlZDU3NzhlN2RjNWQ2MzU5YWMzYTgyNjg5MDRmYTFhM2EzODA0NzQy
11
+ NGJmNGVjOTNjYWIzYzU4ZTk4MjFmNjYxMzUzOTA1N2UzZDY0YWQ=
12
12
  data.tar.gz: !binary |-
13
- YTI2MDBmM2Y4MmVlZDlhM2UyNzk0M2JhOWUzNGNlOWQwODBlMGIwOGRjMDNk
14
- NTViY2RjNDBkNWQzYmUzMDI5NmZmMzExZTAyMzFjMWJkMTlkNjA4ZmJjM2M0
15
- MTFmYzBjYzFiOTE0MzJjYTYyYWVlYTg4NjBlMGJiMjliYjY0YmM=
13
+ OWE4ZjU1YzRlMDUzNDZjYmFkOTExZjM3OGZlZWE2MWI2MmE2YTI1Y2EyZTAy
14
+ ZjFlZDgxNDFkZTFlOTFmYWRhYmVjYTMzODI1NzY5MzQ5YzJiMjIyZTg5Mzg4
15
+ ZTJhNWQ0MTgxMzQwNzE5NjA5MmY5NDYzZWIxMmUwNDgwM2Q3MTA=
@@ -1,6 +1,6 @@
1
1
  module PodloveWebPlayerRails
2
2
  # version of the gem
3
- VERSION = "1.2.0"
3
+ VERSION = "1.2.1"
4
4
  # version of the podlove web player
5
5
  PODLOVE_WEB_PLAYER_VERSION = "2.1.0"
6
6
  end
@@ -5,21 +5,22 @@ module PodloveWebPlayerRails
5
5
  # js method with given option parameters.
6
6
  #
7
7
  # @param [Hash] options options for the player
8
- # @option options [String] :src The location of an audio file, local ore remote.
9
- # @option options [String] :type The media type of the resource.
10
- # @option options [String] :mp4 The location of an audio file with the type mp4.
11
- # @option options [String] :mp3 The location of an audio file with the type mp3.
12
- # @option options [String] :ogg The location of an audio file with the type ogg.
13
- # @option options [String] :opus The location of an audio file with the type opus.
14
- # @option options [String] :poster The location of the cover image for the rich audio player.
8
+ # @option options [string] :src The location of an audio file, local ore remote.
9
+ # @option options [string] :type The media type of the resource.
10
+ # @option options [string] :mp4 The location of an audio file with the type mp4.
11
+ # @option options [string] :mp3 The location of an audio file with the type mp3.
12
+ # @option options [string] :ogg The location of an audio file with the type ogg.
13
+ # @option options [string] :opus The location of an audio file with the type opus.
14
+ # @option options [string] :poster The location of the cover image for the rich audio player.
15
15
  # @option options [integer] :width (auto) The width of the player.
16
16
  # @option options [integer] :height The height of the player.
17
17
  # @option options [boolean] :loop (false) Loops the audio when it ends.
18
- # @option options [boolean] :preload (true) Start loading the audio as soon as possible,
18
+ # @option options [string] :preload (auto) Start loading the video as soon as possible,
19
19
  # before the user clicks play. This might not work on all browsers.
20
+ # Options are: 'auto', 'metadata' and 'none'
20
21
  # @option options [boolean] :autoplay (false) Start playing the audio as soon as it's ready.
21
22
  # This might not work on all (mobile) devices.
22
- # @option options [String] :duration (false) Enables display of duration without having to load the
23
+ # @option options [string] :duration (false) Enables display of duration without having to load the
23
24
  # media file. Use seconds or timecode as a unit
24
25
  # (e.g. "3522" or "00:58:42")
25
26
  # @option options [boolean] :alwaysShowHours (true) Displays the time in 00:00:00 instead of 00:00.
@@ -27,11 +28,11 @@ module PodloveWebPlayerRails
27
28
  # permanently visible.
28
29
  # @option options [boolean] :volume (true) Disables the volume slider.
29
30
  # @option options [boolean] :progress (true) Disables the progress bar.
30
- # @option options [String] :captions URL to a WebVTT captions file.
31
+ # @option options [string] :captions URL to a WebVTT captions file.
31
32
  # @option options [boolean] :chapters Takes chapter string in JSON format and builds an interactive
32
33
  # chapter table. Chapters must be written in the following format:
33
34
  # !{'start':'00:00:00.000', 'title':'Chapter One', 'image':''}
34
- # @option options [String] :chapterlinks (all) Option for the jumplink behaviour in chapter table.
35
+ # @option options [string] :chapterlinks (all) Option for the jumplink behaviour in chapter table.
35
36
  # Options are: 'all' (all chapter links are clickable), 'buffered' (only
36
37
  # buffered chapters are clickable), 'false' (chapters are not linked)
37
38
  # @option options [boolean] :chaptersVisible (false) Defines the default visibility status of
@@ -42,7 +43,7 @@ module PodloveWebPlayerRails
42
43
  # toggable summary module.
43
44
  # @option options [boolean] :downloadbuttonsVisible (false) Defines the default visibility of the
44
45
  # download buttons.
45
- # @return [String] HTML markup and JS call.
46
+ # @return [string] HTML markup and JS call.
46
47
  def podloveaudio(options = {})
47
48
  podlove("audio", options)
48
49
  end
@@ -51,17 +52,18 @@ module PodloveWebPlayerRails
51
52
  # js method with given option parameters.
52
53
  #
53
54
  # @param [Hash] options options for the player
54
- # @option options [String] :src This location of an video file, local ore remote.
55
- # @option options [String] :type The media type of the resource.
56
- # @option options [String] :mp4 The location of an audio file with the type mp4.
57
- # @option options [String] :webm The location of an audio file with the type webm.
58
- # @option options [String] :ogg The location of an audio file with the type ogg.
59
- # @option options [String] :poster The location of the poster frame for the video.
55
+ # @option options [string] :src This location of an video file, local ore remote.
56
+ # @option options [string] :type The media type of the resource.
57
+ # @option options [string] :mp4 The location of an audio file with the type mp4.
58
+ # @option options [string] :webm The location of an audio file with the type webm.
59
+ # @option options [string] :ogg The location of an audio file with the type ogg.
60
+ # @option options [string] :poster The location of the poster frame for the video.
60
61
  # @option options [integer] :width (auto) The width of the player.
61
62
  # @option options [integer] :height The height of the player.
62
63
  # @option options [boolean] :loop (false) Loops the video when it ends.
63
- # @option options [boolean] :preload (true) Start loading the video as soon as possible,
64
+ # @option options [string] :preload (auto) Start loading the video as soon as possible,
64
65
  # before the user clicks play. This might not work on all browsers.
66
+ # Options are: 'auto', 'metadata' and 'none'
65
67
  # @option options [boolean] :autoplay (false) Start playing the video as soon as it's ready.
66
68
  # This might not work on all (mobile) devices.
67
69
  # @option options [boolean] :fullscreen (true) Disables the fullscreen button for video.
@@ -74,11 +76,11 @@ module PodloveWebPlayerRails
74
76
  # controls out when not hovering the video.
75
77
  # @option options [boolean] :volume (true) Disables the volume slider.
76
78
  # @option options [boolean] :progress (true) Disables the progress bar.
77
- # @option options [String] :captions URL to a WebVTT captions file.
79
+ # @option options [string] :captions URL to a WebVTT captions file.
78
80
  # @option options [boolean] :chapters Takes chapter string in JSON format and builds an interactive
79
81
  # chapter table. Chapters must be written in the following format:
80
82
  # !{'start':'00:00:00.000', 'title':'Chapter One', 'image':''}
81
- # @option options [String] :chapterlinks (all) Option for the jumplink behaviour in chapter table.
83
+ # @option options [string] :chapterlinks (all) Option for the jumplink behaviour in chapter table.
82
84
  # Options are: 'all' (all chapter links are clickable), 'buffered' (only
83
85
  # buffered chapters are clickable), 'false' (chapters are not linked)
84
86
  # @option options [boolean] :chaptersVisible (false) Defines the default visibility status of
@@ -89,7 +91,7 @@ module PodloveWebPlayerRails
89
91
  # toggable summary module.
90
92
  # @option options [boolean] :downloadbuttonsVisible (false) Defines the default visibility of the
91
93
  # download buttons.
92
- # @return [String] HTML markup and JS call.
94
+ # @return [string] HTML markup and JS call.
93
95
  def podlovevideo(options = {})
94
96
  podlove("video", options)
95
97
  end
@@ -98,8 +100,9 @@ module PodloveWebPlayerRails
98
100
 
99
101
  def podlove(type, options = {})
100
102
  id = "player_" + SecureRandom.hex(5)
103
+ preload = options[:preload] || "auto"
101
104
 
102
- html = "<#{type} id='#{id}'>"
105
+ html = "<#{type} id='#{id}' preload=#{preload}>"
103
106
  html << "<source src='#{options[:src]}'"\
104
107
  "" + (options[:type] ? " type='#{options[:type]}'" : "") + "></source>" if options[:src]
105
108
  html << "<source src='#{options[:mp4]}' type='#{type}/mp4'></source>" if options[:mp4]
@@ -109,9 +112,9 @@ module PodloveWebPlayerRails
109
112
  html << "<source src='#{options[:webm]}' type='#{type}/webm'></source>" if options[:webm]
110
113
  html << "</#{type}>"
111
114
 
112
- [:src, :type, :mp4, :mp3, :ogg, :opus, :webm].each{ |key| options.delete(key) }
115
+ [:src, :type, :mp4, :mp3, :ogg, :opus, :webm, :preload].each{ |key| options.delete(key) }
113
116
 
114
- script = "$('##{id}').podlovewebplayer(#{options.to_json});"
117
+ script = "jQuery('##{id}').podlovewebplayer(#{options.to_json});"
115
118
 
116
119
  return raw html + "\n" + javascript_tag(script)
117
120
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podlove-web-player-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bastian Bartmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-03 00:00:00.000000000 Z
11
+ date: 2013-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties