Playing Video files in Servoy is still a bit of R&D work for developers. There are no direct Servoy beans and plug-ins available to play video files in Servoy application. And while creating beans and plug-ins for Servoy to play video files, we also need to think about the different video codecs supportability which is really a tedious task.
To meet the above requirement, I have thought up the use of YouTube’s private video feed to store all the related video files. YouTube, itself will take care of the video codecs. Now, another requirement is to play the YouYube videos in Servoy application. We can do the same by using YouTube’s Custom Video Player. The below Tip will show you to create a YouTube Custom Video Player and How to integrate the same in Servoy.
Creating YouTube Custom Video Player
Please, follow the below steps to create a YouTube’s Custom Video Player.
1) Browse to the URL: http://www.youtube.com/custom_player. If you are not signed in, you will see the Login page. You need to login, for generating a Custom Player.
2) You will be landed in a New Player creation form. You need to fill up the information about the player name, description and also can customize your player, such as setting theme, layout etc.
3) In the content section, your videos, your favourites or one of your playlists can be included as the content of this player.
4) After the same, you need to click on the “Generate Code” button, to save and generate the Custom Player code.
5) Finally, in the “Embed Code” section, you will see some HTML code. We need to use this code in Servoy.
Integrating Custom Player
For integrating the Custom Player, you need create an Form/Global variable and assign the same as below.
var varHTML = "";
varHTML += ;
varHTML += "
After that, you can place a Field of Display Type HTML_AREA and set the dataProvider property to the created form/global variable. After running the application, you can see a nice Player Interface, where you have all the inbuilt control to interact with the Video and also have the facility to browse through the specified video feeds.
Note: This will only work in WebClient. For a Rich Client supportability, you can make use of BrowserSuite to set the above HTML String.