Skip to content

Handles the "playAudioWhenScreenIsLocked" similar to the iOS behaviour.#54

Closed
romedius wants to merge 1 commit into
apache:masterfrom
romedius:master
Closed

Handles the "playAudioWhenScreenIsLocked" similar to the iOS behaviour.#54
romedius wants to merge 1 commit into
apache:masterfrom
romedius:master

Conversation

@romedius

@romedius romedius commented May 8, 2015

Copy link
Copy Markdown
Contributor

If the Flag is not set the media will be played (standard behaviour up to now.

If the Flag is set to false, active playing sounds are paused on the Activitys onPause event and resumed after onResume is fired.
The functionality is implemented similarly to the pausedForPhone functionality.

If the Flag is not set the media will be played (standard behaviour up to now.

If the Flag is set to false, active playing sounds are paused on the Activitys onPause event and resumed after onResume is fired.
The functionality is implemented similarly to the pausedForPhone functionality.
@ghenry22

Copy link
Copy Markdown
Contributor

Apparently playAudioWhenScreenIsLocked is deprecated on iOS (from the tickets I was reading today) anyway so this PR could probably be closed if that is correct.

@cordova-qa

Copy link
Copy Markdown

Cordova CI Build has completed successfully.

Commit - Link
Dashboard - Link

Builder Name Console Output Test Report Device Logs
Windows 8.1 Store Link Link Link
Windows 10 Store Link Link Link
Windows 8.1 Phone Link Link Link
iOS Link Link Link
Android Mac Link Link Link

@romedius

romedius commented Nov 10, 2016

Copy link
Copy Markdown
Contributor Author

Hi!
the option is listed as an iOs Quirk, but it seems to be supported.
I would be willing to integrate it into the new plugin version, if i get a heads up that more people would benefit from this contribution.
@stevengill

@katzlbt

katzlbt commented Nov 11, 2016

Copy link
Copy Markdown

@ghenry22 Current sources and README do not indicate any deprecation of playAudioWhenScreenIsLocked in iOS. Which tickets did you read?

https://github.com/apache/cordova-plugin-media/blob/master/README.md
https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-media/index.html

@stevengill

Copy link
Copy Markdown
Contributor

Hey @romedius!

Thanks for sending this in!

I have a few questions I was hoping you could answer to speed up the review.

So right now, media will keep playing in the background by default? And your PR will allow users to pause the media when the app goes to the background. Does that sound correct?

This is how it works in iOS now? @ghenry22 said it was deprecated in iOS. Is this documented somewhere?

Do you have an issue number for this yet? issues.cordova.io

@romedius

Copy link
Copy Markdown
Contributor Author

@stevengill This is exactly the behavior. The media should pause as soon as onPause() is triggered and resumed on onResume()
Currently this feature is documented as "Quirk" on the iOS platform. https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-media/#ios-quirks playAudioWhenScreenIsLocked
I will create a new pull request by tomorrow.

@romedius

Copy link
Copy Markdown
Contributor Author

@stevengill in the newer plugin version, 2.4.0 there is a pauseAllLostFocus() and resumeAllGainedFocus() functionality. Unfortunately that does not works with the playAudioWhenScreenIsLocked parameter. I have to look into that to avoid duplications.
Can you point me to the documentation that explains those functions?

@romedius

Copy link
Copy Markdown
Contributor Author

@stevengill I've created a new pull request. See:
#121

@romedius

Copy link
Copy Markdown
Contributor Author

Replaced by #121

@romedius romedius closed this Nov 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants