helios-videos 0.2.2 → 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 +4 -4
- data/README.md +27 -4
- data/db/migrate/20250510000001_create_helios_videos_videos.rb +14 -2
- data/lib/helios/videos/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8c03ed3c9ea414e292983ce7c1f1d1ac495856f33aaa6905038f8ded18ddaa66
|
|
4
|
+
data.tar.gz: 6deccbb50d252ecb25d463d4c906d14de211d5aafabf8c66a20aa720e46d7063
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f39a5f944414c430914414159a88a40e364068d4a0dc202fe8c6a4bc3d68ff1e6c3df3d426817964855d32dc752b6d1e4b84f7c5bd4d9412fae6e1b734461eb2
|
|
7
|
+
data.tar.gz: 87cdb6e6e05b8c45e643a901b56bd94b463b428e64402f27dc64d84e5558e41a5ebe3e7b799e79417db99cda97bd89aac12801bd5be5f595cb640a18f978ef89
|
data/README.md
CHANGED
|
@@ -18,7 +18,11 @@ bin/rails helios_videos:install:migrations
|
|
|
18
18
|
bin/rails db:migrate
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
**Prerequisites:**
|
|
21
|
+
**Prerequisites:**
|
|
22
|
+
- ActiveStorage must be installed in your host app (`bin/rails active_storage:install`)
|
|
23
|
+
- Add the Ruby gem for your chosen video processor to your **host app's Gemfile**:
|
|
24
|
+
- **Mux**: `gem "mux_ruby"`
|
|
25
|
+
- **Cloudflare**: no additional gem needed (uses HTTP API directly)
|
|
22
26
|
|
|
23
27
|
## Configuration
|
|
24
28
|
|
|
@@ -195,15 +199,34 @@ Helios::Videos::Migration::ConvertVideoJob.perform_later(
|
|
|
195
199
|
)
|
|
196
200
|
```
|
|
197
201
|
|
|
198
|
-
## JavaScript
|
|
202
|
+
## JavaScript Setup
|
|
199
203
|
|
|
200
|
-
|
|
204
|
+
Your host app must import the Stimulus controller and the video player library for your chosen processor.
|
|
205
|
+
|
|
206
|
+
### Mux
|
|
207
|
+
|
|
208
|
+
```javascript
|
|
209
|
+
import '@mux/mux-player' // Required — registers the <mux-player> custom element
|
|
210
|
+
|
|
211
|
+
import { HeliosVideoBlockController } from "helios/videos"
|
|
212
|
+
application.register("helios-video-block", HeliosVideoBlockController)
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**npm dependency** (add to your host app's `package.json`):
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
yarn add @mux/mux-player
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Cloudflare
|
|
201
222
|
|
|
202
223
|
```javascript
|
|
203
224
|
import { HeliosVideoBlockController } from "helios/videos"
|
|
204
|
-
application.register("video-block", HeliosVideoBlockController)
|
|
225
|
+
application.register("helios-video-block", HeliosVideoBlockController)
|
|
205
226
|
```
|
|
206
227
|
|
|
228
|
+
No additional npm packages are needed for Cloudflare — it uses a standard `<video>` element with HLS.
|
|
229
|
+
|
|
207
230
|
### Vite
|
|
208
231
|
|
|
209
232
|
If your host app uses Vite, add an alias so Vite can resolve the gem's JavaScript:
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
class CreateHeliosVideosVideos < ActiveRecord::Migration[8.0]
|
|
2
2
|
def change
|
|
3
|
-
|
|
3
|
+
primary_key_type, foreign_key_type = primary_and_foreign_key_types
|
|
4
|
+
|
|
5
|
+
create_table :helios_videos_videos, id: primary_key_type do |t|
|
|
4
6
|
t.string :name
|
|
5
7
|
t.string :key
|
|
6
8
|
t.jsonb :playback_urls
|
|
7
9
|
t.boolean :requires_signed_urls, default: false, null: false
|
|
8
10
|
t.string :provider
|
|
9
|
-
t.
|
|
11
|
+
t.column :block_id, foreign_key_type
|
|
10
12
|
|
|
11
13
|
t.timestamps
|
|
12
14
|
end
|
|
@@ -15,4 +17,14 @@ class CreateHeliosVideosVideos < ActiveRecord::Migration[8.0]
|
|
|
15
17
|
add_index :helios_videos_videos, :key, unique: true
|
|
16
18
|
add_index :helios_videos_videos, :provider
|
|
17
19
|
end
|
|
20
|
+
|
|
21
|
+
private
|
|
22
|
+
|
|
23
|
+
def primary_and_foreign_key_types
|
|
24
|
+
config = Rails.configuration.generators
|
|
25
|
+
setting = config.options[config.orm][:primary_key_type]
|
|
26
|
+
primary_key_type = setting || :primary_key
|
|
27
|
+
foreign_key_type = setting || :bigint
|
|
28
|
+
[primary_key_type, foreign_key_type]
|
|
29
|
+
end
|
|
18
30
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: helios-videos
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: '0.3'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jason Fleetwood-Boldt
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-05-28 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: rails
|
|
@@ -83,6 +84,7 @@ licenses:
|
|
|
83
84
|
metadata:
|
|
84
85
|
homepage_uri: https://github.com/heliosdev/helios-videos
|
|
85
86
|
source_code_uri: https://github.com/heliosdev/helios-videos
|
|
87
|
+
post_install_message:
|
|
86
88
|
rdoc_options: []
|
|
87
89
|
require_paths:
|
|
88
90
|
- lib
|
|
@@ -97,7 +99,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
97
99
|
- !ruby/object:Gem::Version
|
|
98
100
|
version: '0'
|
|
99
101
|
requirements: []
|
|
100
|
-
rubygems_version: 3.
|
|
102
|
+
rubygems_version: 3.4.19
|
|
103
|
+
signing_key:
|
|
101
104
|
specification_version: 4
|
|
102
105
|
summary: Video upload, processing, and streaming for Rails via Mux or Cloudflare Stream
|
|
103
106
|
test_files: []
|