scrivito_video_widget 1.0.3
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.
- checksums.yaml +7 -0
- data/LICENSE +4 -0
- data/README.md +41 -0
- data/Rakefile +21 -0
- data/app/assets/javascripts/video_widget/application.js +15 -0
- data/app/assets/javascripts/video_widget/projekktor_config.js.coffee +6 -0
- data/app/assets/stylesheets/video_widget/application.css +16 -0
- data/app/assets/stylesheets/video_widget/dynamic_video_container.css +17 -0
- data/app/models/video_widget.rb +16 -0
- data/app/views/video_widget/details.html.erb +7 -0
- data/app/views/video_widget/show.html.erb +5 -0
- data/app/views/video_widget/thumbnail.html.erb +13 -0
- data/lib/scrivito_video_widget/engine.rb +5 -0
- data/lib/scrivito_video_widget/version.rb +3 -0
- data/lib/scrivito_video_widget.rb +4 -0
- data/lib/tasks/scrivito_video_widget_tasks.rake +4 -0
- data/scrivito/migrate/0_create_video_widget.rb +18 -0
- metadata +116 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0dcec067c9ab665e1b699da6955930dc952e6c62
|
4
|
+
data.tar.gz: 92c0765ea05feb5a5206b5dce5e493afb88006ef
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 06f55fd53e4e52ba11ddf9695a44aa7f124d1c159801783747e441f3a3d4bb0ca5e11859665dfef3b015bc23ca88722075344ac1bdfbb948e31031d67836c40c
|
7
|
+
data.tar.gz: 9728772f3efdbf102480527690b0631d94406d979f151cbf190a80d3d334cd08753a97f0d76daa337d80deaaad756c90f773995059bf9923c8c64b63c427c2bc
|
data/LICENSE
ADDED
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# scrivito_video_widget
|
2
|
+
|
3
|
+
[](http://badge.fury.io/rb/scrivito_video_widget)
|
4
|
+
[](https://codeclimate.com/github/Scirvito/scrivito_video_widget)
|
5
|
+
|
6
|
+
A Widget for Scrivito to add a video widget using projekktor.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this lines to your application's `Gemfile`:
|
11
|
+
|
12
|
+
gem 'scrivito_video'
|
13
|
+
gem 'projekktor-rails'
|
14
|
+
|
15
|
+
Add this line to your application Stylesheet manifest:
|
16
|
+
|
17
|
+
*= require video_widget/application
|
18
|
+
|
19
|
+
Add this line to your application javascript manifest:
|
20
|
+
|
21
|
+
/= require video_widget/application
|
22
|
+
|
23
|
+
After that, execute:
|
24
|
+
|
25
|
+
$ bundle
|
26
|
+
$ rake scrivito:migrate:install
|
27
|
+
$ rake scrivito:migrate
|
28
|
+
$ rake scrivito:migrate:publish
|
29
|
+
|
30
|
+
## Changelog
|
31
|
+
|
32
|
+
See [Changelog](https://github.com/Scrivito/scrivito_video_widget/blob/master/CHANGELOG.md) for more
|
33
|
+
details.
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
1. Fork it ( https://github.com/Scrivito/scrivito_video_widget/fork )
|
38
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
39
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
40
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
41
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'ScrivitoVideoWidget'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
Bundler::GemHelper.install_tasks
|
21
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// the compiled file.
|
9
|
+
//
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
12
|
+
//
|
13
|
+
//= require projekktor
|
14
|
+
//= require_tree .
|
15
|
+
//= require_self
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require projekktor
|
14
|
+
*= require_tree .
|
15
|
+
*= require_self
|
16
|
+
*/
|
@@ -0,0 +1,17 @@
|
|
1
|
+
.dynamic-container {
|
2
|
+
position: relative;
|
3
|
+
padding-bottom: 56.25% !important;
|
4
|
+
height: 0;
|
5
|
+
overflow: hidden;
|
6
|
+
&.ratio_4_3 {
|
7
|
+
padding-bottom: 75.00% !important;
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
.projekktor {
|
12
|
+
position: absolute;
|
13
|
+
top: 0;
|
14
|
+
left: 0;
|
15
|
+
width: 100%;
|
16
|
+
height: 100%;
|
17
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class VideoWidget < Widget
|
2
|
+
# Determines the mime type of the video.
|
3
|
+
def mime_type
|
4
|
+
if source.present?
|
5
|
+
source.binary_content_type
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def width
|
10
|
+
self[:width].presence || '660'
|
11
|
+
end
|
12
|
+
|
13
|
+
def height
|
14
|
+
self[:height].presence || '430'
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<div class="dynamic-container">
|
2
|
+
<video class="projekktor" width="100%" height="100%" poster="<%= widget.poster && scrivito_url(widget.poster) %>" controls="controls">
|
3
|
+
<source src="<%= widget.source && scrivito_url(widget.source) %>" type="<%= widget.mime_type %>" />
|
4
|
+
</video>
|
5
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div class="editing-dialog-thumbnail">
|
2
|
+
<div class="visualization">
|
3
|
+
<span class="icon editing-icon-video"></span>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<div class="title">
|
7
|
+
Video
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="description">
|
11
|
+
Displays a video player for the given video file.
|
12
|
+
</div>
|
13
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateVideoWidget < ::Scrivito::Migration
|
2
|
+
def up
|
3
|
+
Scrivito::ObjClass.create(
|
4
|
+
name: 'VideoWidget',
|
5
|
+
is_binary: false,
|
6
|
+
attributes: [
|
7
|
+
{
|
8
|
+
name: 'source',
|
9
|
+
type: :reference,
|
10
|
+
},
|
11
|
+
{
|
12
|
+
name: 'poster',
|
13
|
+
type: :reference,
|
14
|
+
}
|
15
|
+
]
|
16
|
+
)
|
17
|
+
end
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: scrivito_video_widget
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Scrivito
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-11-07 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: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: scrivito_sdk
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: projekktor-rails
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
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: rake
|
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
|
+
description: Scrivito video Widget.
|
70
|
+
email:
|
71
|
+
- support@scrivito.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- LICENSE
|
77
|
+
- README.md
|
78
|
+
- Rakefile
|
79
|
+
- app/assets/javascripts/video_widget/application.js
|
80
|
+
- app/assets/javascripts/video_widget/projekktor_config.js.coffee
|
81
|
+
- app/assets/stylesheets/video_widget/application.css
|
82
|
+
- app/assets/stylesheets/video_widget/dynamic_video_container.css
|
83
|
+
- app/models/video_widget.rb
|
84
|
+
- app/views/video_widget/details.html.erb
|
85
|
+
- app/views/video_widget/show.html.erb
|
86
|
+
- app/views/video_widget/thumbnail.html.erb
|
87
|
+
- lib/scrivito_video_widget.rb
|
88
|
+
- lib/scrivito_video_widget/engine.rb
|
89
|
+
- lib/scrivito_video_widget/version.rb
|
90
|
+
- lib/tasks/scrivito_video_widget_tasks.rake
|
91
|
+
- scrivito/migrate/0_create_video_widget.rb
|
92
|
+
homepage: https://www.scrivito.com
|
93
|
+
licenses:
|
94
|
+
- LGPL-3.0
|
95
|
+
metadata: {}
|
96
|
+
post_install_message:
|
97
|
+
rdoc_options: []
|
98
|
+
require_paths:
|
99
|
+
- lib
|
100
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
requirements: []
|
111
|
+
rubyforge_project:
|
112
|
+
rubygems_version: 2.3.0
|
113
|
+
signing_key:
|
114
|
+
specification_version: 4
|
115
|
+
summary: Scrivito video Widget.
|
116
|
+
test_files: []
|