@Override public void onCastStateChanged(int castState) { switch (castState) { case CastState.CONNECTED: case CastState.CONNECTING: case CastState.NOT_CONNECTED: // devices available case CastState.NO_DEVICES_AVAILABLE: } } }; private AppVisibilityListener appVisibilityListener = new AppVisibilityListener() { @Override public void onAppEnteredForeground() { } @Override public void onAppEnteredBackground() { } };
// up to 5 MediaIntentReceiver.ACTION_TOGGLE_PLAYBACK, MediaIntentReceiver.ACTION_SKIP_NEXT, MediaIntentReceiver.ACTION_DISCONNECT ), new int[] { 0, 2 }) // Show in compat (condensed) view .setSkipStepMs(NotificationOptions.SKIP_STEP_TEN_SECONDS_IN_MS) .setTargetActivityClassName( ExpandedControlsActivity.class.getName()) .build();
// up to 5 MediaIntentReceiver.ACTION_TOGGLE_PLAYBACK, MediaIntentReceiver.ACTION_SKIP_NEXT, MediaIntentReceiver.ACTION_DISCONNECT ), new int[] { 0, 2 }) // Show in compat (condensed) view .setSkipStepMs(NotificationOptions.SKIP_STEP_TEN_SECONDS_IN_MS) .setTargetActivityClassName( ExpandedControlsActivity.class.getName()) .build();
// up to 5 MediaIntentReceiver.ACTION_TOGGLE_PLAYBACK, MediaIntentReceiver.ACTION_SKIP_NEXT, MediaIntentReceiver.ACTION_DISCONNECT ), new int[] { 0, 2 }) // Show in compat (condensed) view .setSkipStepMs(NotificationOptions.SKIP_STEP_TEN_SECONDS_IN_MS) .setTargetActivityClassName( ExpandedControlsActivity.class.getName()) .build();
// up to 5 MediaIntentReceiver.ACTION_TOGGLE_PLAYBACK, MediaIntentReceiver.ACTION_SKIP_NEXT, MediaIntentReceiver.ACTION_DISCONNECT ), new int[] { 0, 2 }) // Show in compat (condensed) view .setSkipStepMs(NotificationOptions.SKIP_STEP_TEN_SECONDS_IN_MS) .setTargetActivityClassName( ExpandedControlsActivity.class.getName()) .build();
// ... MediaInfo info = remoteMediaClient.getMediaInfo(); String title = info.getMetadata().getString(MediaMetadata.KEY_TITLE); TextUtils.isEmpty(title); // empty! Defined keys are reserved for defined media types
// allows binding views to state uiMediaController.bindImageViewToImageOfCurrentItem( playingThumbnail, ImagePicker.IMAGE_TYPE_MINI_CONTROLLER_THUMBNAIL, R.drawable.cast_mini_controller_img_placeholder); uiMediaController.bindViewVisibilityToPreloadingEvent(upNextLayout, View.GONE); // called after all other RemoteMediaClient.Listener uiMediaController.setPostRemoteMediaClientListener(new RemoteMediaClientListener()); Remember -Expanded, this is the hook for it!
Cast Dev Community http://goo.gl/TPLDxj Google I/O https://www.youtube.com/watch?v=Ij9xM4Velno CORS Tips on enabling and testing http://enable-cors.org/ CORS Proxy for dev: https://www.npmjs.com/package/corsproxy Media Tools: ffprobe, exiftool, mediastreamvalidator (apple dev tool) Caleb Smith @co_obec