Skip to content

AutoAdvanceToggle Component

Dananji Withana edited this page Jul 18, 2024 · 5 revisions

This component provides the ability to turn on/off auto-advance from a Canvas to the next when viewing a IIIF Manifest. It reads the behavior property at the Manifest-level, and then parses and stores the given values to a Boolean flag within Ramp's state management.

When behavior is not specified in the Manifest, this is set to not auto-advance as the default temporal behavior due to not specified being the same as no-auto-advance per the IIIF Presentation 3.0 specification.


Props Explained

  • label (String): this has a default value of 'Autoplay and is not required. This allows to customize the text of the label appears next to the auto advance toggle.

  • showLabel (Boolean): this has a default value of true and is not required. This allows to show/hide the label associated with the auto advance toggle.


How to use AutoAdvanceToggle Component?

import {
  IIIFPlayer,
  AutoAdvanceToggle
} from '@samvera/ramp';
import 'video.js/dist/video-js.css';
import '@samvera/ramp/dist/ramp.css';

<IIIFPlayer manifestUrl=manifestUrl manifest=manifest>
    <AutoAdvanceToggle />
</IIIFPlayer>

When auto advance is toggled on: Screenshot 2024-02-08 at 4 43 55 PM

When auto advance is toggled off: Screenshot 2024-02-08 at 4 44 24 PM