Skip to content

Commit

Permalink
Merge pull request #5382 from avalonmediasystem/ending_time
Browse files Browse the repository at this point in the history
Add ending time to range canvas references
  • Loading branch information
masaball authored Sep 26, 2023
2 parents 71c691c + cca1b7c commit 7d72c69
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/iiif_canvas_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def simple_iiif_range(label = stream_info[:embed_title])
IiifManifestRange.new(
label: { "none" => [label] },
items: [
IiifCanvasPresenter.new(master_file: master_file, stream_info: stream_info, media_fragment: 't=0,')
IiifCanvasPresenter.new(master_file: master_file, stream_info: stream_info, media_fragment: "t=0,#{stream_info[:duration]}")
]
)
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/iiif_playlist_canvas_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def simple_iiif_range(label = stream_info[:embed_title])
IiifManifestRange.new(
label: { "none" => [label] },
items: [
IiifPlaylistCanvasPresenter.new(playlist_item: playlist_item, stream_info: stream_info, media_fragment: "t=0,")
IiifPlaylistCanvasPresenter.new(playlist_item: playlist_item, stream_info: stream_info, media_fragment: "t=0,#{stream_info[:duration]}")
]
)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/iiif_canvas_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
expect(subject.label.to_s).to eq "{\"none\"=>[\"#{master_file.embed_title}\"]}"
expect(subject.items.size).to eq 1
expect(subject.items.first).to be_a IiifCanvasPresenter
expect(subject.items.first.media_fragment).to eq 't=0,'
expect(subject.items.first.media_fragment).to eq "t=0,#{(master_file.duration.to_f)/1000}"
end
end
end
Expand Down
1 change: 1 addition & 0 deletions spec/models/iiif_playlist_canvas_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
expect(subject.label.to_s).to eq "{\"none\"=>[\"#{playlist_item.title}\"]}"
expect(subject.items.size).to eq 1
expect(subject.items.first).to be_a IiifPlaylistCanvasPresenter
expect(subject.items.first.media_fragment).to eq "t=0,#{(master_file.duration.to_f)/1000}"
end
end

Expand Down

0 comments on commit 7d72c69

Please sign in to comment.