Document player
Adding the Document Playback Widget
Follow the steps given below to add the Document playback widget in your website.
Get Started
Step 1: Add the following HTML snippet into the body section of your web application code to add the Document playback widget.
<vdz-mashup-document data-widget="true"> </vdz-mashup-document>
Other available input properties for the Document player widget can be found below.
Note: Make sure data-widget property is set to true
as this applies the VIDIZMO default styling to the widget.
Input Properties
Call Document Player methods
Step 2: Add the following code into the body section of your web application code to achieve the available functionality provided by VIDIZMO against this widget. Sample methods can be seen in the following code:
function setZoomLevel() {
document.querySelector('.documentPlayer').setZoomLevel();
}
function goToPage() {
document.querySelector('.documentPlayer').goToPage();
}
Other available methods for the Document player widget can be found below.
Methods
{status :boolean, detail: string}
Listen to Document Player events
Step 3: Add the following code into the body section of your web application to consume and bind the available events for the document player widget.** Sample events can be seen in the following code:
document.querySelector(".documentPlayer").addEventListener('on-mashup-loading', (evt) => {
});
document.querySelector(".documentPlayer").addEventListener('on-mashup-loaded', (evt) => {
});
Other available events for the Document player widget can be found below.
Events
Adding Callbacks
Step 4: Add the following code into the body section of your web application to intercept rendering pipelines and make changes in the data. Sample callback functions can be seen in the following code:
<vdz-mashup-document on-mashup-loading-sync="onLoading" data-widget= "true" mashup-id="174342">
</vdz-mashup-document>
<script>
function onLoading(searchCriteria) {
searchCriteria.mashupIds = [12121]; }
</script>
In the code above, by calling onLoading method, VIDIZMO rendering pipeline is being intercepted during which the user can update the search criteria against which content would be searched. Furthermore, you can do accomplish similar tasks before the search call is initiated.
Callbacks
Sample Code
<html>
<head>
<meta charset="UTF-8" />
<!-- VIDIZMO Imports -->
<script type="text/javascript" src="{portal-address}/static/js/vidizmo-player/player.js">
</script>
<link rel="stylesheet" href="{portal-address}/static/compiled/widget/widgets.css" />
<script type="text/javascript" src="{portal-address}/static/compiled/widget/widgets.js">
</script>
</head>
<body>
<vdz-mashup-document class="document" on-mashup-loading-sync="onLoading" data-widget="true" mashup-id={mashup - id}>
</vdz-mashup-document>
<script>
//methods
function setZoomLevel() {
document.querySelector('.document').setZoomLevel();
}
function goToPage() {
document.querySelector('.document').goToPage();
}
//events
document.querySelector(".document").addEventListener("on-mashup-loading", (event) => {
});
document.querySelector(".document").addEventListener("on-mashup-loaded", (event) => {
});
//Callback
function onLoading(searchCriteria) {
searchCriteria.mashupIds = [newMashupId];
}
</script>
</body>
</html>