vider 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8e53f093f8714c8051593e846e0b1ae656729e73
4
+ data.tar.gz: 1d0dd8102f813a07a57d0ca52174ac2330feaee3
5
+ SHA512:
6
+ metadata.gz: 3e215617d68a0d19ae97046549dafd02819caf30138910780ddcfc508cf0925d05f6a415a0bcd2c125f8494fbd518abc0ef86425db51b06ad5a2c9ea9b6f8e6c
7
+ data.tar.gz: 8466493ebd231e0bb949a1cce60a583112a962b9f22e991508a62de625ac4beb68e10c7bab262d4f58fde51a474a7438dd51ba6e71d23d11ce133a3a99cdbf4c
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Islam Wazery
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,109 @@
1
+ # Vider [![endorse](http://api.coderwall.com/wazery/endorsecount.png)](http://coderwall.com/wazery)
2
+
3
+ A Ruby gem to wrap the functionalities of the Vide jQuery plugin.
4
+
5
+ [![Build Status](https://travis-ci.org/wazery/vider.svg)](https://travis-ci.org/wazery/vider)
6
+ [![Code Climate](https://codeclimate.com/github/wazery/vider/badges/gpa.svg)](https://codeclimate.com/github/wazery/vider)
7
+ [![License](http://img.shields.io/license/MIT.png?color=green)](http://opensource.org/licenses/MIT)
8
+ [![Support Vider Gem](http://img.shields.io/gittip/wbotelhos.svg)](https://www.gittip.com/wazery "Git Tip")
9
+
10
+
11
+ ## TODO
12
+
13
+ 1. Write a RSpec tests for this gem
14
+ 2. :wq
15
+
16
+ ## Installation
17
+
18
+ Add this line to your application's Gemfile:
19
+
20
+ ```ruby
21
+ gem 'vider'
22
+ ```
23
+
24
+ And then execute:
25
+
26
+ $ bundle
27
+
28
+ Or install it yourself as:
29
+
30
+ $ gem install vider
31
+
32
+ Add the required JS file to your `app/assets/javascripts/application.js`
33
+
34
+ //= require jquery.vide
35
+
36
+ ## Notes
37
+
38
+ * All modern desktop browsers are supported.
39
+ * IE9+
40
+ * iOS plays video from a browser only in the native player. So video for iOS is disabled, only fullscreen poster will be used.
41
+ * Some Android devices play video, some not — go figure. So video for Android is disabled, only fullscreen poster will be used.
42
+
43
+ ## Usage
44
+
45
+ Prepare your video in several formats like '.webm', '.mp4' for cross browser compatability, also add a poster with `.jpg`, `.png` or `.gif` extension:
46
+
47
+ ```
48
+ path/
49
+ ├── to/
50
+ │ ├── video.mp4
51
+ │ ├── video.ogv
52
+ │ ├── video.webm
53
+ │ └── video.jpg
54
+ ```
55
+
56
+ ### Vider Tag
57
+
58
+ You can use the Vider view helpers to add video elements to your Rails views.
59
+
60
+ ```erb
61
+ <%= vider_tag 'path/to/video', position: '100% 100%' %>
62
+ ```
63
+
64
+ I recommend the video to be in the assets directory like so for example: `'assets/video.mp4'` Note that video.mp4 will be under `videos` directory
65
+
66
+ ## Options
67
+
68
+ Below is a complete list of options, and matching default values:
69
+
70
+ 1. **volume** default is *1*,
71
+ 2. **playbackRate** default is *1*
72
+ 3. **muted** default is *true*
73
+ 4. **loop** default is *true*
74
+ 5. **autoplay** default is *true*
75
+ 6. **position** default is *"50% 50%"*
76
+ 7. **posterType** default is *"detect"*
77
+
78
+ ## Contributing
79
+
80
+ 1. Fork it ( https://github.com/wazery/vider/fork )
81
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
82
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
83
+ 4. Push to the branch (`git push origin my-new-feature`)
84
+ 5. Create a new Pull Request
85
+
86
+ ## License
87
+ The MIT License (MIT)
88
+
89
+ ```
90
+ Copyright (c) 2014 Islam Wazery, http://www.whitespace.company
91
+
92
+ Permission is hereby granted, free of charge, to any person obtaining a copy
93
+ of this software and associated documentation files (the "Software"), to deal
94
+ in the Software without restriction, including without limitation the rights
95
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
96
+ copies of the Software, and to permit persons to whom the Software is
97
+ furnished to do so, subject to the following conditions:
98
+
99
+ The above copyright notice and this permission notice shall be included in all
100
+ copies or substantial portions of the Software.
101
+
102
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
103
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
104
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
105
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
106
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
107
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
108
+ SOFTWARE.
109
+ ```
@@ -0,0 +1,12 @@
1
+ require "vider/version"
2
+ require 'vider/helpers'
3
+
4
+ module Vider
5
+ module Rails
6
+ class Engine < ::Rails::Engine
7
+ initializer :append_dependent_assets_path, group: :all do |app|
8
+ app.config.assets.precompile += %w( jquery.vide.js vider.js )
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,28 @@
1
+ module ViderVideoTag
2
+
3
+ # A view helper for creating a video background element
4
+ def vider_tag bg, options={}
5
+
6
+ width = options[:width] || '1000px'
7
+ height = options[:height] || '500px'
8
+ volume = options[:volume] || 1
9
+ playback_rate = options[:playback_rate] || 1
10
+ muted = options[:muted] || true
11
+ looping = options[:loop] || true
12
+ autoplay = options[:autoplay] || true
13
+ position = options[:position] || "50% 50%"
14
+ poster_type = options[:poster_type] || "detect"
15
+
16
+ video_options = "volume: #{volume}, playback_rate: #{playback_rate}, muted: #{muted}, loop: #{looping}, autoplay: #{autoplay}, position: #{position}, poster_type: #{poster_type}" || 'loop: false, muted: false, position: 0% 0%'
17
+
18
+ content_tag :div, '', id: 'vider-element', style: "width: #{width}; height: #{height};", data: { vide_bg: bg, vide_options: video_options }
19
+ end
20
+
21
+ # A view helper for creating adding a video background to an existing element
22
+ # TODO: Implement this helper
23
+ def vider_for_element_tag bg, options={}
24
+ end
25
+ end
26
+
27
+ # Add gem's view helpers to ActionView
28
+ ActionView::Base.send :include, ViderVideoTag if defined? ActionView::Base
@@ -0,0 +1,3 @@
1
+ module Vider
2
+ VERSION = "0.0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,147 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vider
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Islam Wazery
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-nc
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: guard-rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: coveralls
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: A Ruby gem to wrap the functionalities of the Vide jQuery plugin.
112
+ email:
113
+ - wazery@ubuntu.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - LICENSE.txt
119
+ - README.md
120
+ - lib/vider.rb
121
+ - lib/vider/helpers.rb
122
+ - lib/vider/version.rb
123
+ homepage: https://github.com/wazery/Vider
124
+ licenses:
125
+ - MIT
126
+ metadata: {}
127
+ post_install_message:
128
+ rdoc_options: []
129
+ require_paths:
130
+ - lib
131
+ required_ruby_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ required_rubygems_version: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
141
+ requirements: []
142
+ rubyforge_project:
143
+ rubygems_version: 2.2.2
144
+ signing_key:
145
+ specification_version: 4
146
+ summary: A Ruby gem to wrap the functionalities of the Vide jQuery plugin.
147
+ test_files: []