Skip to content

Commit

Permalink
Use fragment_identifier in playlist item ranges
Browse files Browse the repository at this point in the history
Media fragments in playlist structure should use the fragments of the
corresponding playlist item, not the full duration of the parent item.
  • Loading branch information
masaball committed Oct 5, 2023
1 parent b483405 commit 43752cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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,#{stream_info[:duration]}")
IiifPlaylistCanvasPresenter.new(playlist_item: playlist_item, stream_info: stream_info, media_fragment: fragment_identifier)
]
)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/iiif_playlist_canvas_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +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}"
expect(subject.items.first.media_fragment).to eq "t=#{playlist_item.start_time / 1000},#{playlist_item.end_time / 1000}"
end
end

Expand Down

0 comments on commit 43752cf

Please sign in to comment.