• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Broadcast video on a Chromecast

pol2095

Lurker
Hello,

I followed this tutorial Building an Android Google Cast Sender App, project sample on GitHub

I created an application on Google Cast SDK Developer Console

I can connect to the Chromecast but the video does not start ???

in MainActivity.java
Java:
private void startVideo() {
    MediaMetadata mediaMetadata = new MediaMetadata( MediaMetadata.MEDIA_TYPE_MOVIE );
    mediaMetadata.putString( MediaMetadata.KEY_TITLE, getString( R.string.video_title ) );

    MediaInfo mediaInfo = new MediaInfo.Builder( getString( R.string.video_url ) )
        .setContentType( getString( R.string.content_type_mp4 ) )
        .setStreamType( MediaInfo.STREAM_TYPE_BUFFERED )
        .setMetadata( mediaMetadata )
        .build();
    try {
        mRemoteMediaPlayer.load( mApiClient, mediaInfo, true )
            .setResultCallback( new ResultCallback<RemoteMediaPlayer.MediaChannelResult>() {
                @Override
                public void onResult( RemoteMediaPlayer.MediaChannelResult mediaChannelResult ) {
                    if( mediaChannelResult.getStatus().isSuccess() ) {
                        mVideoIsLoaded = true;
                        mButton.setText( getString( R.string.pause_video ) );
                    }
                }
            } );
    } catch( Exception e ) {
        Log.e(TAG, "Exception while creating channel", e);
    }
}
"mediaChannelResult.getStatus()" is not dispatched

Thanks
 
Back
Top Bottom