This guide will show you how to implement the Treepodia integration code and show your videos. Embedding the video is recommended for best viewing quality, and a best practice for working with online video.
Including Treepodia HTML5 Player script
In order to integrate with Treepodia’s platform, the Treepodia script should be included in the body of the relevant pages required for integration. We recommend including it at the bottom of the page, before the </body> tag. Note the below script is suitable for both secure (https) and non-secure (http) pages.
Once the “TreepodiaPlayer.js” script has loaded, it will automatically invoke the function “initTreepodia(player)” on the loading page. The function will run only after the page has completed loading. It will retrieve one product context and request its video information.
Creating a placeholder to display the video or its play button
The last step to embed the video is to create a placeholder for it. The placeholder can be any HTML element (div,p,span) and should have a unique ID that was passed in the container parameter. It’s called in the initTreepodia(player) function.
If you choose to use the “popup” method, this element will initiate the video popup.