Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Problem Stopping MediaPlayer

Problem Stopping MediaPlayer

All your problems with Audio, Video and Images.

Problem Stopping MediaPlayer

Postby nicoskk » Fri Sep 02, 2011 8:27 am

Hi,
i have a BroadcastReceiver class that listens for Incoming Calls. When the BroadcastReceiver is called i want to start a Mediaplayer and when its called for a second time the MediaPlayer should be stopped.

I initialize the MediaPlayer in the BroadcastReceiver but when i am trying to get its status (mediaplayer.isPlaying()) i always gives false.

Where should i initialize the MediaPlayer, so i can start and stop playing the sound?

Regards,
Nicos
nicoskk
Freshman
Freshman
 
Posts: 8
Joined: Fri May 21, 2010 7:42 am

Top

Re: Problem Stopping MediaPlayer

Postby jonbonazza » Fri Sep 02, 2011 3:01 pm

Initializing the mediaplayer does not "play" it.

the isPlaying() method determines if its playing or not, not whether or not it is in initialized.

Instead of checking for isPlaying(), try checking whether or not it is null.
jonbonazza
Master Developer
Master Developer
 
Posts: 665
Joined: Thu Jul 15, 2010 2:58 pm
Location: WV USA

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 6 guests