protected void setupBroadcaster() { // By making the recorder static we can allow // recording to continue beyond this fragment's // lifecycle! That means the user can minimize the app // or even turn off the screen without interrupting the recording! // If you don't want this behavior, call stopRecording // on your Fragment/Activity's onStop() if (getActivity().getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { if (mBroadcaster == null) { if (VERBOSE) Log.i( TAG, "Setting up Broadcaster for output " + Kickflip.getSessionConfig().getOutputPath() + " client key: " + Kickflip.getApiKey() + " secret: " + Kickflip.getApiSecret()); // TODO: Don't start recording until stream start response, so we can determine stream // type... Context context = getActivity().getApplicationContext(); mBroadcaster = new Broadcaster( context, Kickflip.getSessionConfig(), Kickflip.getApiKey(), Kickflip.getApiSecret()); mBroadcaster.getEventBus().register(this); mBroadcaster.setBroadcastListener(Kickflip.getBroadcastListener()); Kickflip.clearSessionConfig(); } } }