samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/VideoConsumptionWithDetailCardFragment.java
private static void playWhenReady(PlaybackGlue glue) {
        if (glue.isPrepared()) {
            glue.play();
        } else {
            glue.addPlayerCallback(new PlaybackGlue.PlayerCallback() {
                @Override
                public void onPreparedStateChanged(PlaybackGlue glue) {
                    if (glue.isPrepared()) {
                        glue.removePlayerCallback(this);
                        glue.play();
                    }
                }
            });
        }
    }
/**
     * helper function for playBackGlue to add/ remove callbacks
     *
     * @param glue The playback glue attached to this fragment
     */
helper function for playBackGlue to add/ remove callbacks
@param glue The playback glue attached to this fragment
helper function for playBackGlue to add / remove callbacks @param glue The playback glue attached to this fragment
private static void playWhenReady(PlaybackGlue glue) {
        if (glue.isPrepared()) {
            glue.play();
        } else {
            glue.addPlayerCallback(new PlaybackGlue.PlayerCallback() {
                @Override
                public void onPreparedStateChanged(PlaybackGlue glue) {
                    if (glue.isPrepared()) {
                        glue.removePlayerCallback(this);
                        glue.play();
                    }
                }
            });
        }
    }
private static void playWhenReady ( PlaybackGlue glue ) { if ( glue . isPrepared ( ) ) { glue . play ( ) ; } else { glue . addPlayerCallback ( new PlaybackGlue . PlayerCallback ( ) { @ Override public void onPreparedStateChanged ( PlaybackGlue glue ) { if ( glue . isPrepared ( ) ) { glue . removePlayerCallback ( this ) ; glue . play ( ) ; } } } ) ; } }
helper function for playBackGlue to add/ remove callbacks
 @param glue The playback glue attached to this fragment
helper function for playBackGlue to add / remove callbacks @param glue The playback glue attached to this fragment