Essential JMF: Developer's Java Media Players
Authors: Rob Gordon, Stephen Talley
Venue:  (1999)

From the Book:PREFACE: PrefaceWhat This Book Is AboutThis book describes the Java Media Framework (JMF) API and how to use itto integrate audio and video playback into Java applications and applets.The JMF API consists of three pieces: playback, capture and video conferencing.This book covers only the first piece, specifically, the Java MediaPlayer API.This book does not stop at the API, however. It also discusses the differentimplementations of that API, how they differ, and even their failure to conformto the API. Where the API is open to interpretation, a discussion of variousinterpretations is undertaken.This discussion appears in the context of developing a framework for build-ingyour own custom Player implementation. The framework code appearingin this book provides all the API-compliance code necessary for building anAPI-compliant Java Media Player, leaving you to focus on the media-specificcoding issues.Finally, this book has sprinkled throughout examples from the EssentialJMF Toolkit, a collection of reusable Java classes for many multimedia occasions.1Who Should Read This Book?This book is written for the Java engineer or aspiring Java engineer who needsto integrate audio and video into his applications or applets. It assumes somefamiliarity with the Java language but you need not be an expert. Webmasterswith JavaScript and perl experience could easily adopt some of the examplesin this book for rudimentary multimedia applications. In other words, if youare interested in Java and multimedia, this book becomes you.1Cocktail parties, barmitzvahs,baptisms, etc.Who Should Buy This Book?Everyone.Structure of This BookThis book contains four distinct parts. We have even named the parts andinserted a decorative page between them so there is no doubt as to which iswhich.Part I, "Using the Java Media Framework," comprises the first ten chapters.Part I was written for the reader who wants to learn to use the JMF Player.After finishing Part I, you will know all there is to know about using a Playerfor playback of currently supported media types.If that is not enough to satisfy you, Part II, "Extending the Java MediaFramework," will show you how to build a complete Player to support a newmedia type. Not only will Part II show you how to do this, but when you arefinished, you will have a good deal of code available to use with still newerand more exciting media types.In addition, Part II covers the building of a custom GUI for a Player, againproviding lots of reusable code. And, if that were not enough, Part II coversthe creation of a new DataSource for support of an actual protocol, the NNTPprotocol for downloading articles from news groups. Put together the customPlayer and DataSource developed in Part II and you have a Java Media Playerfor reading articles from your favorite news group. Strange, but elegant!In Part III, "Building JMF Applets and Applications," a simple media mixerapplication is presented. Using this application you can generate HTML forinclusion in your web pages that need to playback multiple media sources.The MultiPlayer class, also presented in Part III, can then be dropped rightinto your applet to play the media described by the HTML.The books finishes up with a collection of appendices in Part IV. Hereinyou will find complete reference material for the JMF API and the EssentialJMF Toolkit. There is also a discussion of the use of the JMF with variousbrowsers, some potentially useful URL resources and a virtual glossary, toboot.Using This BookThe first three parts of this book can, more or less, stand alone. If you do nothave an immediate need to create your own Player, reading Part I and referencingthe appendices as needed will meet your needs.If you need to create your own custom Player to support a new media format,Part II is for you. If you are in a real hurry, you may be able to get by withjust reading Chapter 18, "Creating a Custom Player." You can at least startthere and refer back to earlier chapters in Part II as necessary. In any case,understanding Part II really depends upon having the knowledge and wisdomcontained in Part I. If you did not get such knowledge from somewhere else,you may as well get it from there.If you need an easy way to play multiple media files from an applet, godirectly to Part III.Part IV is the work horse section of the book: It is there when you need it,ready and willing.We recommend you do not read this book backwards. We cannot guaranteethat there are no hidden, satanic messages.Gathering the PiecesTo derive the fullest benefit and pleasure from reading this book, you willneed to have the following pieces of software installed on your computingdevice. A version of the JDKThe Swing component set from the Java Foundation ClassesAn implementation of the JMFThe Essential JMF example source and ToolkitA section is dedicated to the acquisition and installation of each of thesepieces. In addition to this software, there is the presumption that some fundamentalsoftware already exists on your computer, specifically, the necessaryaudio and video device drivers. For Solaris and Windows machines that havenot been butchered by an overzealous system administrator, this a safeassumption.Downloading JDKTo use Sun's implementation of the JMF, you will first need to have installedsome flavor of JDK 1.1.x. The latest version is available at ...