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:
Ritesh Shukla
2025-08-27 03:06:57 +05:30
committed by GitHub
parent 170d146964
commit 94ba3af9d1
21 changed files with 359 additions and 56 deletions

View File

@@ -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>

View File

@@ -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)
}
}