mirror of
https://github.com/Jellify-Music/App.git
synced 2026-02-19 10:19:04 -06:00
Adding Cast Support (#489)
Adds Google Cast Speaker Support! A new button is now present in the bottom left of the player screen. Pressing this button will prompt the user to pick a Cast enabled speaker. Once a speaker is selected, the player controls in Jellify will control the playback of the Cast speaker.
This commit is contained in:
@@ -36,5 +36,8 @@
|
||||
<action android:name="android.media.browse.MediaBrowserService" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<meta-data
|
||||
android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
|
||||
android:value="com.reactnative.googlecast.GoogleCastOptionsProvider" />
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -5,6 +5,11 @@ import com.facebook.react.ReactActivity
|
||||
import com.facebook.react.ReactActivityDelegate
|
||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
|
||||
import com.facebook.react.defaults.DefaultReactActivityDelegate
|
||||
import com.reactnative.googlecast.api.RNGCCastContext
|
||||
import android.os.Bundle
|
||||
import androidx.annotation.Nullable
|
||||
|
||||
|
||||
|
||||
class MainActivity : ReactActivity() {
|
||||
|
||||
@@ -20,5 +25,12 @@ class MainActivity : ReactActivity() {
|
||||
*/
|
||||
override fun createReactActivityDelegate(): ReactActivityDelegate =
|
||||
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
|
||||
|
||||
|
||||
override fun onCreate(@Nullable savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
// lazy load Google Cast context (if supported on this device)
|
||||
RNGCCastContext.getSharedInstance(this)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user