Solved

embed JMF player in html page

Posted on 2011-03-03
8
1,297 Views
Last Modified: 2012-05-11
I am new to JMF.
I need to embed a player in html to render a video stream of H.264 codec. I went through the following link http://grack.com/downloads/school/enel619.10/report/java_media_framework.html, and added the below lines between html tags then saved the file as test.html.

<APPLET CODE=PlayerApplet WIDTH=320 HEIGHT=300>
<PARAM NAME=FILE VALUE="sparkle2.mpeg">
</APPLET>

But if i try to open the html file I got an error. Below I pasted the JavaConsole information.

java.io.IOException: Permission Denied: From an applet cannot read media file with extension mpeg
java.io.IOException: Permission Denied: From an applet cannot read media file with extension mpeg
Got exception javax.media.NoPlayerException: Error instantiating class: com.sun.media.protocol.file.DataSource : java.io.IOException: Permission Denied: From an applet cannot read media file with extension mpeg
java.lang.NullPointerException
      at PlayerApplet.start(PlayerApplet.java:47)
      at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
Exception: java.lang.NullPointerException

Help me...
0
Comment
Question by:Sumanbabu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 35025937
You need to load the media file with the following technique
getClass().getResourceAsStream(getParameter("FILE"));

Open in new window

0
 
LVL 47

Accepted Solution

by:
for_yan earned 250 total points
ID: 35025963

That's what is written in this article:
http://en.wikipedia.org/wiki/Java_Media_Framework

Many JMF developers have complained that the JMF implementation supplied in up-to-date JRE's supports relatively few up-to-date codecs and formats. Its all-Java version, for example, cannot play MPEG-2, MPEG-4, Windows Media, RealMedia, most QuickTime movies, Flash content new
0
 
LVL 2

Author Comment

by:Sumanbabu
ID: 35025988
Could you please tell me where can I add the above line ?
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 2

Author Closing Comment

by:Sumanbabu
ID: 35026412
Thanks for your help folks. It worked with .avi format.

How ever please suggest me where can I get the plug-ins to support other formats like wmv,mpeg, mpg, mp3 etc :)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35027863
>> It worked with .avi format.

What did you do to get it working?
0
 
LVL 92

Expert Comment

by:objects
ID: 35031324
0
 
LVL 92

Expert Comment

by:objects
ID: 35031339
and if you want to use an applet to access files on the local disk then you'll need to sign its jars
0
 
LVL 2

Author Comment

by:Sumanbabu
ID: 35033510
hello @CHEJ,

I did not change any thing to work with .avi format. I simply used .avi file instead of .mpeg file.
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question