diff --git a/app/models/iiif_canvas_presenter.rb b/app/models/iiif_canvas_presenter.rb index bd2eceba36..968761cfa6 100644 --- a/app/models/iiif_canvas_presenter.rb +++ b/app/models/iiif_canvas_presenter.rb @@ -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 diff --git a/app/models/iiif_playlist_canvas_presenter.rb b/app/models/iiif_playlist_canvas_presenter.rb index 3c3a3a15a8..9d53f28514 100644 --- a/app/models/iiif_playlist_canvas_presenter.rb +++ b/app/models/iiif_playlist_canvas_presenter.rb @@ -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 diff --git a/spec/models/iiif_canvas_presenter_spec.rb b/spec/models/iiif_canvas_presenter_spec.rb index 27cd02cb42..2c583bb043 100644 --- a/spec/models/iiif_canvas_presenter_spec.rb +++ b/spec/models/iiif_canvas_presenter_spec.rb @@ -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 diff --git a/spec/models/iiif_playlist_canvas_presenter_spec.rb b/spec/models/iiif_playlist_canvas_presenter_spec.rb index bb01d6e0fa..c07ff0674f 100644 --- a/spec/models/iiif_playlist_canvas_presenter_spec.rb +++ b/spec/models/iiif_playlist_canvas_presenter_spec.rb @@ -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