acts_as_kaltura 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +82 -1
- data/lib/acts_as_kaltura.rb +1 -1
- data/lib/acts_as_kaltura/video.rb +0 -9
- metadata +53 -59
data/README.md
CHANGED
@@ -1 +1,82 @@
|
|
1
|
-
|
1
|
+
# ActsAsKaltura
|
2
|
+
|
3
|
+
Kaltura is SaaS based video streaming platform, officially kaltura ruby API is available [here](http://corp.kaltura.com/Products/Kaltura-API). Another fork could be found [here](https://github.com/Velir/kaltura-ruby).
|
4
|
+
Based on velir kaltura ruby library, we [somewhere in... ruby devs](http://www.somewherein.net) have built this gem to simplify kaltura video and cuepoint synchronization process.
|
5
|
+
|
6
|
+
## Remaining tasks
|
7
|
+
|
8
|
+
> * Fix specs
|
9
|
+
> * Integrate with travis-ci
|
10
|
+
|
11
|
+
## acts_as_kaltura_video
|
12
|
+
|
13
|
+
It sync your video model with kaltura MediaEntry.
|
14
|
+
|
15
|
+
### Usages -
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
class Video
|
19
|
+
acts_as_kaltura_video :delegate => [:thumbnail_url, :duration]
|
20
|
+
|
21
|
+
# Set media entry object based on your required fields
|
22
|
+
def as_kaltura_entry
|
23
|
+
Kaltura::MediaEntry.new.tap do |entry|
|
24
|
+
entry.name = title
|
25
|
+
entry.description = description
|
26
|
+
entry.tags = tags.map &:name
|
27
|
+
entry.media_type = Kaltura::Constants::Media::Type::VIDEO
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
```
|
32
|
+
### Video model must includes the following fields -
|
33
|
+
|
34
|
+
> * kaltura_key (string)
|
35
|
+
|
36
|
+
> * kaltura_syncd_at (datetime)
|
37
|
+
|
38
|
+
if you use `:delegate => [kaltura web service fields]` you have to add fields for each delegatable field.
|
39
|
+
ie. for `:delegate => [:thumbnail_url]` you have to add `:thumbnail_url` (text) to video model.
|
40
|
+
|
41
|
+
### Create video
|
42
|
+
```ruby
|
43
|
+
Video.create(:title => 'My birthday video', :description => 'Great family moments', :video_file => ..)
|
44
|
+
```
|
45
|
+
|
46
|
+
### Using delegate methods
|
47
|
+
`Video.first.thumbnail_url` it will check local `thumbnail_url` attribute if not found it will retrieve thumbnail through kaltura web service and it will run `update_column :thumbnail_url, value`.
|
48
|
+
|
49
|
+
## acts_as_kaltura_annotation
|
50
|
+
|
51
|
+
It will sync your `Annotation` model with kaltura cuepoint annotation object.
|
52
|
+
|
53
|
+
### Usages -
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
class Annotation < ActiveRecord::Base
|
57
|
+
belongs_to :video
|
58
|
+
acts_as_kaltura_annotation
|
59
|
+
|
60
|
+
def as_annotation_cuepoint
|
61
|
+
ActsAsKaltura::Extension::KalturaAnnotation.new.tap do |cp|
|
62
|
+
cp.cue_point_type = ActsAsKaltura::Extension::KalturaAnnotation::TYPE_ANNOTATION
|
63
|
+
|
64
|
+
# convert to milliseconds
|
65
|
+
cp.start_time = self.start_time.to_i * 1000
|
66
|
+
cp.end_time = self.end_time.to_i * 1000
|
67
|
+
|
68
|
+
cp.system_name = self.title
|
69
|
+
cp.text = self.description
|
70
|
+
cp.entry_id = self.video.kaltura_key
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
```
|
75
|
+
### Annotation model must includes the following fields -
|
76
|
+
|
77
|
+
> * cuepoint_key (String)
|
78
|
+
|
79
|
+
## How to install
|
80
|
+
> gem install acts_as_kaltura
|
81
|
+
|
82
|
+
|
data/lib/acts_as_kaltura.rb
CHANGED
@@ -146,15 +146,6 @@ module ActsAsKaltura
|
|
146
146
|
rescue
|
147
147
|
|
148
148
|
end
|
149
|
-
|
150
|
-
def as_kaltura_entry
|
151
|
-
Kaltura::MediaEntry.new.tap do |entry|
|
152
|
-
entry.name = title
|
153
|
-
entry.description = description
|
154
|
-
entry.tags = tags.map &:name
|
155
|
-
entry.media_type = Kaltura::Constants::Media::Type::VIDEO
|
156
|
-
end
|
157
|
-
end
|
158
149
|
end
|
159
150
|
end
|
160
151
|
end
|
metadata
CHANGED
@@ -1,70 +1,67 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_kaltura
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
4
5
|
prerelease:
|
5
|
-
version: 1.0.0
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- nhm tanveer hossain khan
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-02-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: jeweler
|
17
|
-
requirement: &
|
16
|
+
requirement: &2152680600 !ruby/object:Gem::Requirement
|
18
17
|
none: false
|
19
|
-
requirements:
|
20
|
-
- -
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version:
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
|
-
version_requirements: *
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name:
|
28
|
-
requirement: &
|
24
|
+
version_requirements: *2152680600
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rails
|
27
|
+
requirement: &2152691880 !ruby/object:Gem::Requirement
|
29
28
|
none: false
|
30
|
-
requirements:
|
31
|
-
- -
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version:
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.1.3
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
|
-
version_requirements: *
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
39
|
-
requirement: &
|
35
|
+
version_requirements: *2152691880
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: sqlite3
|
38
|
+
requirement: &2152690240 !ruby/object:Gem::Requirement
|
40
39
|
none: false
|
41
|
-
requirements:
|
42
|
-
- -
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
version:
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
45
44
|
type: :runtime
|
46
45
|
prerelease: false
|
47
|
-
version_requirements: *
|
48
|
-
- !ruby/object:Gem::Dependency
|
46
|
+
version_requirements: *2152690240
|
47
|
+
- !ruby/object:Gem::Dependency
|
49
48
|
name: velir_kaltura-ruby
|
50
|
-
requirement: &
|
49
|
+
requirement: &2152686640 !ruby/object:Gem::Requirement
|
51
50
|
none: false
|
52
|
-
requirements:
|
53
|
-
- -
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version:
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
56
55
|
type: :runtime
|
57
56
|
prerelease: false
|
58
|
-
version_requirements: *
|
59
|
-
description:
|
57
|
+
version_requirements: *2152686640
|
58
|
+
description: Acts as kaltura
|
60
59
|
email: hasan@somewherein.net
|
61
60
|
executables: []
|
62
|
-
|
63
61
|
extensions: []
|
64
|
-
|
65
|
-
extra_rdoc_files:
|
62
|
+
extra_rdoc_files:
|
66
63
|
- README.md
|
67
|
-
files:
|
64
|
+
files:
|
68
65
|
- lib/acts_as_kaltura.rb
|
69
66
|
- lib/acts_as_kaltura/annotation.rb
|
70
67
|
- lib/acts_as_kaltura/callbacks.rb
|
@@ -78,32 +75,29 @@ files:
|
|
78
75
|
- lib/acts_as_kaltura/two_way_attr_accessor.rb
|
79
76
|
- lib/acts_as_kaltura/video.rb
|
80
77
|
- README.md
|
81
|
-
homepage:
|
78
|
+
homepage: http://hasan.we4tech.com
|
82
79
|
licenses: []
|
83
|
-
|
84
80
|
post_install_message:
|
85
81
|
rdoc_options: []
|
86
|
-
|
87
|
-
require_paths:
|
82
|
+
require_paths:
|
88
83
|
- lib
|
89
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
85
|
none: false
|
91
|
-
requirements:
|
92
|
-
- -
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version:
|
95
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
91
|
none: false
|
97
|
-
requirements:
|
98
|
-
- -
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version:
|
92
|
+
requirements:
|
93
|
+
- - ! '>='
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
101
96
|
requirements: []
|
102
|
-
|
103
97
|
rubyforge_project:
|
104
98
|
rubygems_version: 1.8.10
|
105
99
|
signing_key:
|
106
100
|
specification_version: 3
|
107
|
-
summary: An extension for supporting acts_as_kaltura_video and acts_as_kaltura_annotation
|
101
|
+
summary: An extension for supporting acts_as_kaltura_video and acts_as_kaltura_annotation
|
102
|
+
(which automatically maintains kaltura video and cuepoint)
|
108
103
|
test_files: []
|
109
|
-
|