掲示板

Preview/play video in Liferay

thumbnail
12年前 に Juan Gonzalez P によって更新されました。

Preview/play video in Liferay

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Hi all!

I am thinking about developing a preview/play video feature for Liferay document library. It would be something like previewing documents in Liferay 6.1. I wanted to make it for Liferay core (not portlet or ext-plugin).

After looking throught code (current trunk) I think I am going to follow these steps :

  • Create new class (VideoProcessorUtil). It will be something like com.liferay.portlet.documentlibrary.util.PDFProcessorUtil. This class should manage all necessary code to create flash file that would be saved as file preview. In this step, how could I add libraries to Liferay?
  • Create new messageListener to execute that file preview process (I guess this is made this way for PDF to be asynchronous), same as PDFProcessorMessageListener. I should have to add the listener properly in file META-INF/messaging-misc-spring.xml to enable it.
  • Modify portal-web/docroot/html/portlet/document_library/view_file_entry.jsp to get the preview and write all required javascript to render the video player (initially could be flash like FlowPlayer or JWPlayer). Here I have another question. What is the easiest (and correct) way to know if a file is of one type or another (video, etc), so I can call different classes to get the previews from different manner?


Any suggestions will be appreciated! All this work will be commited to Liferay staff so they can get it into Liferay code.

Thanks!
thumbnail
12年前 に Jorge Ferrer によって更新されました。

RE: Preview/play video in Liferay

Liferay Legend 投稿: 2871 参加年月日: 06/08/31 最新の投稿
Hi Juan,

First of all, thanks a lot for working on this. Please find my answers below.
Juan Gonzalez P:

Create new class (VideoProcessorUtil). It will be something like com.liferay.portlet.documentlibrary.util.PDFProcessorUtil. This class should manage all necessary code to create flash file that would be saved as file preview. In this step, how could I add libraries to Liferay?


Sounds good. If you mean adding new JAR files. You need to add them within the lib/portal directory in the Liferay sources. Also, you should add an entry in lib/versions.xml to register information about the JAR. Note that it's only possible to include libraries that use a license that is Open Source, compatible with LGPL and that doesn't add additional restrictions (like GPL). For example, Apache, LGPL, MIT or BSD licenses are all fine.

Juan Gonzalez P:

Create new messageListener to execute that file preview process (I guess this is made this way for PDF to be asynchronous), same as PDFProcessorMessageListener. I should have to add the listener properly in file META-INF/messaging-misc-spring.xml to enable it.


Yup, this all sounds good.

Juan Gonzalez P:

Modify portal-web/docroot/html/portlet/document_library/view_file_entry.jsp to get the preview and write all required javascript to render the video player (initially could be flash like FlowPlayer or JWPlayer). Here I have another question. What is the easiest (and correct) way to know if a file is of one type or another (video, etc), so I can call different classes to get the previews from different manner?


The fileEntry object has a getMimeType() method that you can use for that.

Regarding the video player, be aware of the license, which I think rules out those two options. Flowplayer is GPL and JW Player is not Open Source (it just has a non-commercial CC license). The only editor that I've seen out there whose license would allow inclusion in Liferay is http://f4player.org/ (LGPL license) and http://openvideoplayer.sourceforge.net/flash (BSD license)
thumbnail
12年前 に Juan Gonzalez P によって更新されました。

RE: Preview/play video in Liferay

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Jorge Ferrer:

Regarding the video player, be aware of the license, which I think rules out those two options. Flowplayer is GPL and JW Player is not Open Source (it just has a non-commercial CC license). The only editor that I've seen out there whose license would allow inclusion in Liferay is http://f4player.org/ (LGPL license) and http://openvideoplayer.sourceforge.net/flash (BSD license)


Hi Jorge,
Seems good both of them. I'll try and chose the best.

Thanks for pointing that out....
thumbnail
12年前 に Hitoshi Ozawa によって更新されました。

RE: Preview/play video in Liferay

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
If it's going to be part of the core, please also consider internationalization when selecting the player.
thumbnail
12年前 に Jorge Ferrer によって更新されました。

RE: Preview/play video in Liferay

Liferay Legend 投稿: 2871 参加年月日: 06/08/31 最新の投稿
Hi Hitoshi,

That's a good point. Can you take a look at the two players that I linked to and let us know if they have good internationalization support?
thumbnail
12年前 に Juan Gonzalez P によって更新されました。

RE: Preview/play video in Liferay

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Jorge Ferrer:
Hi Hitoshi,

That's a good point. Can you take a look at the two players that I linked to and let us know if they have good internationalization support?



Hi Jorge,

I couldn't make working Open Video Player demo (that seems the best player for me), so for the moment I am going to use mpw player (demo here: http://nettuts.s3.amazonaws.com/274_flashVideo/Source/index.html). It has valid license for Liferay, check it to be sure. These player doesn't have any text so doesn't require internationalization at the moment (after make this new feature working I will try to change to Open Video Player).
thumbnail
12年前 に Juan Gonzalez P によって更新されました。

RE: Preview/play video in Liferay

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
thumbnail
12年前 に Jorge Ferrer によって更新されました。

RE: Preview/play video in Liferay

Liferay Legend 投稿: 2871 参加年月日: 06/08/31 最新の投稿
Hi Juan,

FLV Flash Fullscreen looks quite good, seems quite flexible and it's LGPL. For MPW player I couldn't find the license.
thumbnail
12年前 に Juan Gonzalez P によって更新されました。

RE: Preview/play video in Liferay

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Jorge Ferrer:
Hi Juan,

FLV Flash Fullscreen looks quite good, seems quite flexible and it's LGPL. For MPW player I couldn't find the license.


Sorry Jorge,

That link was to see a working demo.

Project link is this:

http://sourceforge.net/projects/mpwplayer/

and it seems it has BSD license.
thumbnail
12年前 に Jorge Ferrer によって更新されました。

RE: Preview/play video in Liferay

Liferay Legend 投稿: 2871 参加年月日: 06/08/31 最新の投稿
Hi Juan,

Thanks for the link. I'll let you choose the one that you think is best. We can always extract everything specific to the player to a single JSP so that it's easy to replace it with another one from a hook.
thumbnail
12年前 に Juan Gonzalez P によって更新されました。

RE: Preview/play video in Liferay

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
I almost have it! Now I can preview video files without downloading them! Just as Youtube does :-P

Before uploading the patch and instructions I wanna ask a few things:

* when viewing a document I check what extension that files has, to show different javascript (to build the viewer with right params and URL's). Is there any way to check if a file is video type (extensions avi, mov, etc) or do I have to check the extensions in the same condition one by one?
* what is the best way of adding environmental variables to Liferay? Because I am using Xuggler to encode videos to other format (flv) I have to set some variables (I can do this in TOMCAT setenv.sh file, but don't know if there are better ways to do that).
thumbnail
12年前 に Jorge Ferrer によって更新されました。

RE: Preview/play video in Liferay

Liferay Legend 投稿: 2871 参加年月日: 06/08/31 最新の投稿
Juan Gonzalez P:

* when viewing a document I check what extension that files has, to show different javascript (to build the viewer with right params and URL's). Is there any way to check if a file is video type (extensions avi, mov, etc) or do I have to check the extensions in the same condition one by one?

I think it's better to use the mime type which is available through the fileEntry object.

Juan Gonzalez P:

* what is the best way of adding environmental variables to Liferay? Because I am using Xuggler to encode videos to other format (flv) I have to set some variables (I can do this in TOMCAT setenv.sh file, but don't know if there are better ways to do that).


You can use system.properties for that.
thumbnail
12年前 に Juan Gonzalez P によって更新されました。

RE: Preview/play video in Liferay

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Hi guys!

I am very close to finish this.

I have only a few corrections on this, like adjusting the size of the viewer, and other little ones....

I hope to upload a patch tomorrow and the instructions to get this working (in fact install Xuggler will be the required step).

See the attached file to see how does it look like...

Enjoy!
10年前 に sureshnaik ramavath によって更新されました。

RE: Preview/play video in Liferay

New Member 投稿: 18 参加年月日: 13/06/14 最新の投稿
Hi juan,

Xuggler:
We need to install Xuggler .
Xuggler allows for audio and video previews and lets you play audio and video files in your browser and extracts thumbnails from video files. and it supports most of the media formats.


Thanks,
Suresh.
thumbnail
9年前 に Mohammad Hejazi によって更新されました。

RE: Preview/play video in Liferay

New Member 投稿: 6 参加年月日: 14/11/09 最新の投稿
Hi all
Xuggler:
Xuggler set and install in liferay 6.2 but not play video in liferay document
thumbnail
9年前 に Juan Gonzalez によって更新されました。

RE: Preview/play video in Liferay

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Mohammad Hejazi:
Hi all
Xuggler:
Xuggler set and install in liferay 6.2 but not play video in liferay document



Please open a new thread for this problem you are having, and try to ellaborate a little bit more.
thumbnail
12年前 に Juan Gonzalez P によって更新されました。

RE: Preview/play video in Liferay

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
FYI, I've created a JIRA for this feature:

http://issues.liferay.com/browse/LPS-18004
10年前 に karthik reddy によって更新されました。

RE: Preview/play video in Liferay

Junior Member 投稿: 60 参加年月日: 13/04/08 最新の投稿
Juan Gonzalez:
FYI, I've created a JIRA for this feature:
Hi I am trying this requirement like to preview the video and also I want to play the video in same place.Can you please share me the steps for preview and play through documents and media library

Thanks & Regards
M.Karthik Reddy
http://issues.liferay.com/browse/LPS-18004
thumbnail
10年前 に Juan Gonzalez によって更新されました。

RE: Preview/play video in Liferay

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Hi karthik,

please read this wiki:

http://www.liferay.com/es/community/wiki/-/wiki/Main/Preview+Generation#section-Preview+Generation-Audio+and+Video+Previews