bloggers bloggers

Marco Napolitano
Messaggi: 68
Stelle: 0
Data: 15/11/17
Jader Jed Francia
Messaggi: 50
Stelle: 0
Data: 22/09/17
Ezio Lombardi
Messaggi: 9
Stelle: 0
Data: 23/06/17
Chiara Mambretti
Messaggi: 25
Stelle: 0
Data: 27/02/17
Serena Traversi
Messaggi: 3
Stelle: 0
Data: 21/07/16
Francesco Falanga
Messaggi: 8
Stelle: 0
Data: 14/06/16
Antonio Musarra
Messaggi: 2
Stelle: 0
Data: 18/11/13
Simone Celli Marchi
Messaggi: 6
Stelle: 0
Data: 09/07/13
marcello marangio
Messaggi: 4
Stelle: 0
Data: 05/07/13
Marco Mancini
Messaggi: 1
Stelle: 0
Data: 05/06/13
Indietro

Un semplice player video per il web

Per visualizzare nella nostra pagina web video in streaming bastano poche operazioni.

Tramite FlowPlayer, un player open source diponibile in rete (qui), possiamo rapidamente rendere fruibili i nostri video a chi accede al nostro sito.

Per prima cosa abbiamo bisogno del player swf (flowplayer-3.1.5.swf) e della libreria Javascript per utilizzarlo (flowplayer-3.1.4.min.js).

I passi che rimangono sono molto semplici:

  • Includere nella nostra pagina il Javascript

<scriptsrc="path/to/the/flowplayer-3.1.4.min.js"></script>

  • mettere nel nostro codice html il link al video che vogliamo mostrare:
<a
href="path/to/video"
style="display:block;width:425px;height:300px;"
id="player">
</a>
  • Per finire, tramite una chiamata Javascript, caricare il player nel tag <a> inserito precedentemente:

<scriptlanguage="JavaScript">
flowplayer("player","path/to/the/flowplayer-3.1.5.swf");
</script>

Attenzione al primo parametro del metodo flowplayer: deve necessariamente essere uguale all'id che assegniamo al tag <a> ("player" nel nostro caso).

FlowPlayer supporta tre tipi di formati video: flv, h.264 e mp4. E' possibile configurarlo in molti modi diversi. Se ad esempio vogliamo impedire la visualizzazione fullscreen ci basterà chiamare il metodo precedente in questo modo:

<script language="JavaScript">
flowplayer("player", "
path/to/the/flowplayer-3.1.5.swf",{
plugins: {
controls: {
fullscreen: false
}
}
});
</script>

Può inoltre essere esteso con plugin disponibile in rete.

Per maggiori informazioni andate qui.


Precedente
Commenti
Aggiungi Commento
Salvatore Costanza
Ciao, la versione 6.2 contiene la possibilità di visualizzare i video abilitando il plugin xuggler direttamente da property: xuggler.enabled=true.
Purtroppo nonostante abbia installato, oltre a xuggler, anche il plugin imagemagick e ghostscript continuo ad avere errori sul caricamento e forte instabilità del server.
Riuscireste a darmi qualche dritta?
Grazie

Ecco i log del server al caricamento del file
13:31:10,215 ERROR [liferay/document_library_video_processor-1][VideoProcessorImpl:573] java.util.concurrent.ExecutionException: com.liferay.portal.kernel.process.ProcessException: Subprocess terminat
ed with exit code 1
java.util.concurrent.ExecutionException: com.liferay.portal.kernel.process.ProcessException: Subprocess terminated with exit code 1
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at com.liferay.portal.kernel.process.ProcessExecutor$ProcessExecutionFutureResult.get(ProcessExecutor.java:474)
at com.liferay.portlet.documentlibrary.util.VideoProcessorImpl._generateVideoXuggler(VideoProcessorImpl.java:529)
at com.liferay.portlet.documentlibrary.util.VideoProcessorImpl._generateVideoXuggler(VideoProcessorImpl.java:559)
at com.liferay.portlet.documentlibrary.util.VideoProcessorImpl._generateVideo(VideoProcessorImpl.java:455)
at com.liferay.portlet.documentlibrary.util.VideoProcessorImpl.generateVideo(VideoProcessorImpl.java:110)
at com.liferay.portlet.documentlibrary.util.VideoProcessorUtil.generateVideo(VideoProcessorUtil.java:36)
at com.liferay.portlet.documentlibrary.messaging.VideoProcessorMessageListener.generate(VideoProcessorMessageListener.java:32)
at com.liferay.portlet.documentlibrary.messaging.BaseProcessorMessageListener.doReceive(BaseProcessorMessageListener.java:36)
at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
at com.liferay.portal.kernel.messaging.SerialDestination$1.run(SerialDestination.java:65)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.liferay.portal.kernel.process.ProcessException: Subprocess terminated with exit code 1
at com.liferay.portal.kernel.process.ProcessExecutor$SubprocessReactor.call(ProcessExecutor.java:617)
at com.liferay.portal.kernel.process.ProcessExecutor$SubprocessReactor.call(ProcessExecutor.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
... 1 more
13:31:11,455 ERROR [liferay/document_library_video_processor-1][VideoProcessorImpl:375] java.util.concurrent.ExecutionException: com.liferay.portal.kernel.process.ProcessException: Subprocess terminat
ed with exit code 1
java.util.concurrent.ExecutionException: com.liferay.portal.kernel.process.ProcessException: Subprocess terminated with exit code 1
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at com.liferay.portal.kernel.process.ProcessExecutor$ProcessExecutionFutureResult.get(ProcessExecutor.java:474)
at com.liferay.portlet.documentlibrary.util.VideoProcessorImpl._generateThumbnailXuggler(VideoProcessorImpl.java:353)
at com.liferay.portlet.documentlibrary.util.VideoProcessorImpl._generateVideo(VideoProcessorImpl.java:467)
at com.liferay.portlet.documentlibrary.util.VideoProcessorImpl.generateVideo(VideoProcessorImpl.java:110)
at com.liferay.portlet.documentlibrary.util.VideoProcessorUtil.generateVideo(VideoProcessorUtil.java:36)
at com.liferay.portlet.documentlibrary.messaging.VideoProcessorMessageListener.generate(VideoProcessorMessageListener.java:32)
at com.liferay.portlet.documentlibrary.messaging.BaseProcessorMessageListener.doReceive(BaseProcessorMessageListener.java:36)
at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
at com.liferay.portal.kernel.messaging.SerialDestination$1.run(SerialDestination.java:65)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.liferay.portal.kernel.process.ProcessException: Subprocess terminated with exit code 1
at com.liferay.portal.kernel.process.ProcessExecutor$SubprocessReactor.call(ProcessExecutor.java:617)
at com.liferay.portal.kernel.process.ProcessExecutor$SubprocessReactor.call(ProcessExecutor.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
... 1 more
13:31:11,472 ERROR [liferay/document_library_video_processor-1][VideoProcessorImpl:473] com.liferay.portal.kernel.exception.SystemException: com.liferay.portlet.documentlibrary.NoSuchFileException: do
cument_thumbnail/10184/97/41313/41314.jpg
com.liferay.portal.kernel.exception.SystemException: com.liferay.portlet.documentlibrary.NoSuchFileException: document_thumbnail/10184/97/41313/41314.jpg
at com.liferay.portlet.documentlibrary.util.VideoProcessorImpl._generateThumbnailXuggler(VideoProcessorImpl.java:387)
at com.liferay.portlet.documentlibrary.util.VideoProcessorImpl._generateVideo(VideoProcessorImpl.java:467)
at com.liferay.portlet.documentlibrary.util.VideoProcessorImpl.generateVideo(VideoProcessorImpl.java:110)
at com.liferay.portlet.documentlibrary.util.VideoProcessorUtil.generateVideo(VideoProcessorUtil.java:36)
at com.liferay.portlet.documentlibrary.messaging.VideoProcessorMessageListener.generate(VideoProcessorMessageListener.java:32)
at com.liferay.portlet.documentlibrary.messaging.BaseProcessorMessageListener.doReceive(BaseProcessorMessageListener.java:36)
at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
at com.liferay.portal.kernel.messaging.SerialDestination$1.run(SerialDestination.java:65)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.liferay.portlet.documentlibrary.NoSuchFileException: document_thumbnail/10184/97/41313/41314.jpg
at com.liferay.portlet.documentlibrary.store.BaseStore.addFile(BaseStore.java:112)
at com.liferay.portlet.documentlibrary.store.StoreProxyImpl.addFile(StoreProxyImpl.java:55)
at com.liferay.portlet.documentlibrary.store.SafeFileNameStoreWrapper.addFile(SafeFileNameStoreWrapper.java:73)
at com.liferay.portlet.documentlibrary.store.DLStoreImpl.addFile(DLStoreImpl.java:108)
at com.liferay.portlet.documentlibrary.store.DLStoreUtil.addFile(DLStoreUtil.java:124)
at com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor.addFileToStore(DLPreviewableProcessor.java:238)
at com.liferay.portlet.documentlibrary.util.VideoProcessorImpl.storeThumbnailImages(VideoProcessorImpl.java:295)
at com.liferay.portlet.documentlibrary.util.VideoProcessorImpl._generateThumbnailXuggler(VideoProcessorImpl.java:378)
... 11 more
Inviato il 18/09/15 15.34.