Documente Academic
Documente Profesional
Documente Cultură
Liferay
Most of the times we have a requirement from the client to show videos on the home page for marketing
purpose or to promote the brands. At that time I looked into the internet for so many different players but I
found the Flow Player as the Most efficient and easy to integrate it.
Below are some of the Features of Flow Player which make him so much popular:Basic Features
Play/Pause Controls
FullScreen
Playlist
o
o
o
o
Advance Features
Common Clipping ( for eg. :- you can set the duration for all the files in the playlist to
play for only 5 seconds )
Clipping ( for eg. :- you can set the duration for each and every individual file in the
playlist)
Advertising ( You can integrate Advertising in the Flowplayer same as you see in the
youtube )
Streaming ( Online streaming from live server )
There are so many different video formats are available on Internet. Some Particular format of Video
required respective company's Player but some other formats are open and other players can play them.
As FlowPlayer runs on Flash Video Object, so it can virtually handle all format which are supported by
flash.
Here I am going to show you the small demo about how to integrate Flow Player in Liferay and play
videos with the help of it.
List of the necessary files required in order to integrate Flow Player with Liferay are as below:-
2) Put the JavaScript and Flash Files in the Document and Media.
3) Most appropriate way, put the Javascript files in the Theme and Flash Files in Document and
Media.
1) Creating Structure
After Clicking on the Add Structure button the below screen appears.
Name and Description are the fields in order to name the Structure and also give appropriate description
for that structure.
After Scrolling Down you will find XML Schema Definition section. Click on the Add Row button and go on
adding as per below screenshot.
After clicking on the Add Template button the below screen appears.
Name and Description are the fields in order to name the Template and also give appropriate description
for that Template.
Cacheable is for caching the content.
Structure Selection is for selecting the structure that we have created
Language Type is for writting the Template code in different languages (VM,CSS,FTL,XSL)
Launch Editor will open the Screen in which you will be able to write the Template Code.
As you see in screenshot, the Editor with Default Code. Remove that Default Code and add below code in
your editor.
<script type="text/javascript"
src="$imagePath/../js/flowplayer-3.2.11.min.js"></script>
<script type="text/javascript"
src="$imagePath/../js/jquery1.8.js"></script>
<a href="$VideoFile.getData()" class="player"
id="player" ></a>
<script type="text/javascript">
$(document).ready(function()
{
flowplayer("player", "$SwfPlayer.getData()",
{
plugins:{
controls: {
url:
"$SwfPlayerControl.getData()"
}
}
}
);
});
</script>
view rawFlow Player Template.xml hosted with by GitHub
2nd and 3rd line is for importing the javascript file that we need to include in Flow Player. But one
important thing is that as our Javascript File is in the JS Folder so we moved upto JavaScript Path from
ImagePath accordingly.
Now we have defined link with id as player and href is the location where we will get video file
path from the Web-Content Dynamically.
As we have written Flow Player configuration in ready function of the JavaScript. So When the
page will be loaded and it will be ready then Javascript ready function will get called. In that our Flow
Player function will be called.
First parameter in the flow player function is the id of the anchor where we want to place the flow
player.
Second parameter in the flow player function is the parameter that contains the Main SWF File
Path.
Third Parameter is the Plugins of the Flow Player. Here we used Play/Pause, Slider that contains
inside the Plugins swf.
We can add more parameter if we want in the Flow Player functions.
3) Creating Web-Content
There are two option either Basic Web Content or Flow Player :If you select Basic Web Content then you have to manually select Structure and Template for that web
content.
But if you select FlowPlayer then it will automatically select Structure and Template of Flow Player.
After Clicking on it below screen appears.