samvera_hls 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/samvera_hls/hls_playlist_generator.rb +8 -2
- data/lib/samvera_hls/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b3d2e4963cff58d279c08687c0ff43634a5dd7ff23e3d44d2d0aae3c0a806e8
|
4
|
+
data.tar.gz: cbb413ab704a1878a4827bd718ba42ae43205de409600f90d0328bf7913d01c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f43322dd51a20ed089825353a1238589624e1da9bffd2a07c3046336569045277ae62a8c9465a2a8407fb201fe3b8dc079f1820caca64d060c4c9f9a2d58a83f
|
7
|
+
data.tar.gz: 3040cb55263808cc6e8e4b925aa775752157b11ece6e85c13c34574ae17a09685a373e85bc968b0d41ae396d008d18ae59de9b31d9b152fa8b16e38286adffb9
|
@@ -42,13 +42,19 @@ module SamveraHls
|
|
42
42
|
timestamp = Time.now.to_i + 7200
|
43
43
|
|
44
44
|
playlist = ""
|
45
|
+
|
45
46
|
File.open(segment_playlist_path(file_set_id, format),'r') {|file|
|
47
|
+
|
46
48
|
file.each_line do |line|
|
47
49
|
if line.include? ".ts" then
|
50
|
+
# We only need to set the token once for each variant file.
|
51
|
+
# It doesn't depend on which segment we're playing, so we
|
52
|
+
# speed things up by only calculating one.
|
53
|
+
variant_token ||= token(file_set_id,line, timestamp)
|
48
54
|
playlist << File.join(root_url,
|
49
55
|
segment_url_base(file_set_id),
|
50
56
|
timestamp.to_s,
|
51
|
-
|
57
|
+
variant_token,
|
52
58
|
line).strip+"\n"
|
53
59
|
else
|
54
60
|
playlist << line.strip+"\n"
|
@@ -77,7 +83,7 @@ module SamveraHls
|
|
77
83
|
end
|
78
84
|
|
79
85
|
def token id, line, timestamp
|
80
|
-
|
86
|
+
Digest::SHA256.hexdigest("/" + File.join(segment_url_base(id),timestamp.to_s,line).strip[0...-9] + token_secret)
|
81
87
|
end
|
82
88
|
|
83
89
|
def segment_playlist_path id, format
|
data/lib/samvera_hls/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: samvera_hls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ned Henry, UCSC Library Digital Initiatives
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|