Book Image

Primefaces Cookbook Second Edition

Book Image

Primefaces Cookbook Second Edition

Overview of this book

Table of Contents (20 chapters)
PrimeFaces Cookbook Second Edition
Credits
Foreword
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Embedding the multimedia content in JSF pages


The media component offers ways for embedding various multimedia content into a JSF page.

How to do it…

A simple definition of media component for displaying a QuickTime movie will be as follows:

<p:media value="/resources/media/sample_iTunes.mov"
  width="700" height="500" />

The visual output of the player will be as follows:

Tip

Use the width and height attributes of the media component in order to declare the viewport of the player.

How it works…

By default, the media component renders the regarding HTML markup into the page according to the extension of the given file. The players and the matching extensions are listed as follows:

Player

Supported types

Flash

FLV, MP3, and SWF

PDF

PDF

QuickTime

AIF, AIFF, AAC, AU, BMP, GSM, MOV, MID, MIDI, MPG, MPEG, MP4, M4A, PSD, QT, QTIF, QIF, QTI, SND, TIF, TIFF, WAV, 3G2, and 3PG

Real

RA, RAM, RM, RPM, RV, SMI, and SMIL

Windows

ASX, ASF, AVI, WMA, and WMV

If the player cannot be resolved from...