Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start Video without Audio Focus #896

Merged

Conversation

S3basuchian
Copy link
Contributor

I have added two options to IFramePlayerOptions :

  • autoplay
  • mute

If both of these values are initialized with 1, the video will autoplay in a muted mode without gaining Audio Focus (meaning Spotify or other background playbacks will continue). As soon as the player is unmuted with the unMute() function, it will acquire audio focus again.
I think this should fix the issues #691 and #397

@PierfrancescoSoffritti
Copy link
Owner

Hey, thanks for the PR! can you please send it to the dev branch instead of master?

I will try to review it over the weekend :)

@S3basuchian S3basuchian changed the base branch from master to dev November 4, 2022 12:56
@S3basuchian
Copy link
Contributor Author

Sure thing :)

README.md Outdated
@@ -29,6 +29,7 @@ A lengthier explanation to why you may want to consider using an alternative to

A list of published apps that are using this library: ([let me know](https://github.com/PierfrancescoSoffritti/android-youtube-player/issues) if you want to add your app to this list)

- [Genius](https://play.google.com/store/apps/details?id=com.genius.android)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mm not sure why this is here, i might have messed up when i updated the readme 😬 anyway, to keep this change clean, can you remove this line?

}

/**
* Controls if the video is muted.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to something like: "Controls if the player will be initialized mute or not."

@@ -66,6 +68,24 @@ class IFramePlayerOptions private constructor(private val playerOptions: JSONObj
return this
}

/**
* Controls if the video is played automatically.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to something like: "Controls if the video is played automatically after the player is initialized"

@S3basuchian
Copy link
Contributor Author

I have removed the readme changes and changed the wording of the method descriptions 👍🏻

Copy link
Owner

@PierfrancescoSoffritti PierfrancescoSoffritti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@PierfrancescoSoffritti PierfrancescoSoffritti merged commit b1bee58 into PierfrancescoSoffritti:dev Nov 5, 2022
@PierfrancescoSoffritti
Copy link
Owner

Thanks for the help :)

PierfrancescoSoffritti added a commit to Praveen-Pable/android-youtube-player that referenced this pull request Mar 13, 2023
* Update readme (PierfrancescoSoffritti#875)

Add Genius to the apps that are using the library

* added mute option

* added mute option

* changed wording of new method descriptions

* removed link in README.md

Co-authored-by: Pierfrancesco Soffritti <[email protected]>
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.

2 participants