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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d881449562a1e2af768f7fcf9012c6b743cb88564af549ce400ba96615f2a3d
4
- data.tar.gz: 2251575e721c1ac7bcdd3867c4c9dcf53f65d4e1182421a0a3d5493e96b8ffc7
3
+ metadata.gz: 5b3d2e4963cff58d279c08687c0ff43634a5dd7ff23e3d44d2d0aae3c0a806e8
4
+ data.tar.gz: cbb413ab704a1878a4827bd718ba42ae43205de409600f90d0328bf7913d01c8
5
5
  SHA512:
6
- metadata.gz: fe6cd29081a34e72daa9b902479dd03671c6f53660fe6d46574fe810c6ba341558b427667465e9b5b06bb978b7855df77449670589bca3eed4485c2b347b63b0
7
- data.tar.gz: eb8e4238723a9ba6a0d09be1d10e2ee3fd22cb0639cb7637632673ea7e5900f0c07dfcfb657702ad9e41bd75e40b1676691e718d54573b9dd08517aeeaf9e4bb
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
- token(file_set_id,line, timestamp),
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
- @token ||= Digest::SHA256.hexdigest("/" + File.join(segment_url_base(id),timestamp.to_s,line).strip[0...-9] + token_secret)
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
@@ -1,3 +1,3 @@
1
1
  module SamveraHls
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
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.1
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-04 00:00:00.000000000 Z
11
+ date: 2019-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails