hyrax-active_encode 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/README.md +28 -1
- data/app/services/hyrax/active_encode/active_encode_derivative_service.rb +27 -1
- data/lib/hyrax/active_encode/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34ece920ad0628dac4dc89e5036fcc9fab4456b6
|
4
|
+
data.tar.gz: 15e14410451f633c4de5153969899f75fe98fa7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f953f2a34f1cfe253bc82bb1e01cbddcf5a8341118aadecca634b258cdfe6fdef3adf75f4a970b5388561938f47782789b17676408eadde8a81bf1f2cf2f3dc
|
7
|
+
data.tar.gz: fe90475f0891d184bd569891d7a60abbec0b3d29fa8a36e20f0083720af2febbcd7f6dcb224d5a885891f0cd41e8e2d4dd10afde1e8c64c7958588b532851c80
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -1,2 +1,29 @@
|
|
1
1
|
# hyrax-active_encode
|
2
|
-
Hyrax plugin to enable audiovisual derivative generation through active_encode
|
2
|
+
Hyrax plugin to enable audiovisual derivative generation through [active_encode](https://github.com/samvera-labs/active_encode).
|
3
|
+
|
4
|
+
## Installation
|
5
|
+
|
6
|
+
Add this line to your application's Gemfile:
|
7
|
+
|
8
|
+
```
|
9
|
+
gem 'hyrax-active_encode'
|
10
|
+
```
|
11
|
+
|
12
|
+
And then execute:
|
13
|
+
|
14
|
+
$ bundle
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
To enable derivative generation through `active_encode` run the install generator which will modify the generated `FileSet` model:
|
19
|
+
|
20
|
+
$ rails g hyrax:active_encode:install
|
21
|
+
|
22
|
+
## Configuration
|
23
|
+
|
24
|
+
By default, hyrax-active_encode will use ActiveEncode's FFmpeg adapter and default ffmpeg options which will generate derivatives matching the defaults in Hyrax.
|
25
|
+
|
26
|
+
`Hyrax::ActiveEncode::ActiveEncodeDerivativeService` can be passed an option service which should return the output options array that will be passed to Hydra-Derivatives and then to ActiveEncode. See (https://github.com/samvera-labs/hyrax-active_encode/blob/master/app/services/hyrax/active_encode/default_option_service.rb) for the default option service.
|
27
|
+
|
28
|
+
`Hyrax::ActiveEncode::ActiveEncodeDerivativeService` can also be passed the ActiveEncode encode class to be used. By default this will be `ActiveEncode::Base`.
|
29
|
+
|
@@ -4,9 +4,35 @@ require 'active_encode'
|
|
4
4
|
module Hyrax
|
5
5
|
module ActiveEncode
|
6
6
|
class ActiveEncodeDerivativeService < Hyrax::DerivativeService
|
7
|
+
class << self
|
8
|
+
def default_encode_class=(klass)
|
9
|
+
@@default_encode_class = klass
|
10
|
+
end
|
11
|
+
|
12
|
+
def default_encode_class
|
13
|
+
@@default_encode_class ||= ::ActiveEncode::Base
|
14
|
+
end
|
15
|
+
|
16
|
+
def default_options_service_class=(klass)
|
17
|
+
@@default_options_service_class = klass
|
18
|
+
end
|
19
|
+
|
20
|
+
def default_options_service_class
|
21
|
+
@@default_options_service_class ||= Hyrax::ActiveEncode::DefaultOptionService
|
22
|
+
end
|
23
|
+
|
24
|
+
def default_local_streaming=(local_streaming)
|
25
|
+
@@default_local_streaming = local_streaming
|
26
|
+
end
|
27
|
+
|
28
|
+
def default_local_streaming
|
29
|
+
@@default_local_streaming ||= true
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
7
33
|
attr_accessor :encode_class, :options_service_class
|
8
34
|
|
9
|
-
def initialize(file_set, encode_class:
|
35
|
+
def initialize(file_set, encode_class: self.class.default_encode_class, options_service_class: self.class.default_options_service_class, local_streaming: self.class.default_local_streaming)
|
10
36
|
super(file_set)
|
11
37
|
@encode_class = encode_class
|
12
38
|
@options_service_class = options_service_class
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyrax-active_encode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Colvard
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2018-10-
|
15
|
+
date: 2018-10-09 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: active_encode
|