You Are Here:

Community: Developer Discussion Boards

#1 Old Exclamation Problems with media player - 2007-04-17, 08:09

Join Date: Feb 2007
Posts: 25
michaelhann89
Offline
Registered User
I am tryin to create a media player that uses the MMAPI to open up a media file stored on the phone.

i have tried using the MIDP: Mobile Media API develpoers guide with no success. When i load a stream nothing happens

Code:
inputStream is = getClass().getResourceAsStream(address);
            Player player = Manager.createPlayer(is,"video/3gpp");
            player.addPlayerListener(this);
            player.realize();
            player.prefetch();
               
            VideoControl vc = (VideoControl)player.getControl("VideoControl");
            if (videoControl == null) {
                midlet.alertError("VideoControl not supported"); 
            } else {
              
                vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
                videoControl.setVisible(true);
                player.start();  
            }
i have also tried with :
Code:
        try {
            //inputStream is = getClass().getResourceAsStream(address);
            Player player = Manager.createPlayer(address);
            player.addPlayerListener(this);
            player.realize();
            player.prefetch();
               
            VideoControl vc = (VideoControl)player.getControl("VideoControl");
            if (videoControl == null) {
                midlet.alertError("VideoControl not supported"); 
            } else {
              
                vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
                videoControl.setVisible(true);
                player.start();  
            }
and have also tried
Code:
        try {
            //inputStream is = getClass().getResourceAsStream(address);
            Player player = Manager.createPlayer(address);
            player.addPlayerListener(this);
            player.realize();
            player.prefetch();
            player.start();   
            VideoControl vc = (VideoControl)player.getControl("VideoControl");
            if (videoControl == null) {
                midlet.alertError("VideoControl not supported"); 
            } else {
              
                vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
                videoControl.setVisible(true);
                  
            }
this one the sound will play but no video
the other two examples just the alertError is created. Any help would be greatly appreciated. The try statements are caught but i just left that part of the code out to save room.
Address is an app property that points on an address on the phone in this case file:///C:/Data/Vidoes/t2.3gp
i have tried more than one file but none see to work.
Last edited by michaelhann89 : 2007-04-18 at 03:10.
Reply With Quote

#2 Old Re: Problems with media player - 2007-04-17, 15:42

Join Date: Jul 2003
Posts: 14
mikbry
Offline
Registered User
Hi,

You need to use fileconnection:

import javax.microedition.io.file.*;

FileConnection fc = (FileConnection)Connector.open(filepath);
Player player = Manager.createPlayer(fc.openInputStream(),"video/3gpp");

You also need to setup file access permissions.

BR,

Mik
miklabs.com
Reply With Quote

#3 Old Re: Problems with media player - 2007-04-18, 02:32

Join Date: Feb 2007
Posts: 25
michaelhann89
Offline
Registered User
i tried using the file connection like u said but it still comes up the the error that video control is not supported.i have no idea y. any help would be great.

oh and its a nokia N80 if that helps
Last edited by michaelhann89 : 2007-04-18 at 02:54.
Reply With Quote

#4 Old Re: Problems with media player - 2007-04-18, 05:37

Join Date: Nov 2003
Posts: 3,641
Location: Bangalore , India
Send a message via Yahoo to balagopalks
balagopalks's Avatar
balagopalks
Offline
Forum Nokia Expert
Give a try with MIDP: Mobile Media API Example - Media Sampler
http://www.forum.nokia.com/info/sw.n..._v1_0.zip.html

Regards
Gopal

__________________
MobiQuil.com
An initiative by Developers for Developers.
http://www.mobiquil.com - Alpha - Launched.
Reply With Quote

#5 Old Re: Problems with media player - 2007-04-18, 06:47

Join Date: Feb 2007
Posts: 25
michaelhann89
Offline
Registered User
hey balagopalks.

am using that to make this program but for some reason mine wont work. have trid varying it in many ways. just not sure what i am doin wrong
Reply With Quote

#6 Old Re: Problems with media player - 2007-04-19, 07:14

Join Date: Feb 2007
Posts: 25
michaelhann89
Offline
Registered User
i figured out the problem.

it was an error with som eof the naming.

thank you all for your help
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Create 3GP player with J2ME for Mobile dexxa05 Mobile Java Media (Graphics & Sounds) 53 2008-03-27 20:52
Nokia 3250 Media Player Problems smash555 General Discussion 2 2007-02-26 13:03
Nokia E60 - Media player problems... Guntis Audio 0 2007-02-06 00:50
SIP content type hlothman Symbian Networking & Messaging 8 2006-05-17 10:26

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ