-
Notifications
You must be signed in to change notification settings - Fork 5
Starting Guide
Dananji Withana edited this page Oct 12, 2023
·
4 revisions
In order to use this in an application you should have the following;
- Installed node version > 10
- ReactJS version >= 16.8.0
Depending on your environment use either of the following commands to fetch the package from NPM:
yarn add @samvera/iiif-react-media-player
OR
npm install @samvera/iiif-react-media-player
yarn add video.js
yarn add videojs-hotkeys
import React from 'react';
import { IIIFPlayer, MediaPlayer, StructuredNavigation, Transcript } from "@samvera/ramp";
import 'video.js/dist/video-js.css';
// Import starter styles (in the future this will be optional)
import "@samvera/ramp/dist/ramp.css";
const App = () => {
// Get your manifest from somewhere
const manifestUrl = "https://some-manifest-url-here.json";
return (
<IIIFPlayer manifestUrl={manifestUrl}>
<MediaPlayer />
<StructuredNavigation />
<Transcript {...props} />
</IIIFPlayer>
);
}
export default App;
import React from 'react';
import { Transcript } from "@samvera/iiif-react-media-player";
// Import starter styles (in the future this will be optional)
import "@samvera/iiif-react-media-player/dist/iiif-react-media-player.css";
const App = () => {
return (
<Transcript playerID={playerID} transcripts={[
{
canvasId: 0,
items: [
{
title: 'Title',
url: 'http://example.com/transcript.json'
}
]
}
]}/>
);
}
export default App;