We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm having a probem when using this library. When I exit the activity, I'm calling the following:
fragment.closePlayer(); // does nothing
This one always return null for the view.
YoutubeTvView view = (YoutubeTvView) findViewById(fr.bmartel.youtubetv.R.id.youtubetv_view); if (view != null) { view.stopVideo(); view.closePlayer(); }
This is the activity I'm using:
public class YoutubePlaybackActivity extends Activity { private static final String TAG = YoutubePlaybackActivity.class.getSimpleName(); public static final String EXTRA_VIDEO_ID = "videoId"; public static final String EXTRA_CONTENT_LIST = "ContentList"; private YouTubePlayerView mYouTubePlayerView; private static final String API_KEY = "AIzaSyBgDhyTYKAIfDlHODy-r6BopuhTTNp7nro"; private YoutubeTvFragment mFragment; public void toggleHideyBar() { // The UI options currently enabled are represented by a bitfield. // getSystemUiVisibility() gives us that bitfield. int uiOptions = getWindow().getDecorView().getSystemUiVisibility(); int newUiOptions = uiOptions; boolean isImmersiveModeEnabled = ((uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) == uiOptions); if (isImmersiveModeEnabled) { Log.i(TAG, "Turning immersive mode mode off. "); } else { Log.i(TAG, "Turning immersive mode mode on."); } newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN; newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; getWindow().getDecorView().setSystemUiVisibility(newUiOptions); } @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_youtube_playback); toggleHideyBar(); Bundle args = new Bundle(); args.putString("videoId", getIntent().getStringExtra(EXTRA_VIDEO_ID)); args.putString("videoQuality", "hd1080"); mFragment = YoutubeTvFragment.newInstance(args); FragmentTransaction transaction = getFragmentManager().beginTransaction(); transaction.add(R.id.root, mFragment); transaction.commit(); } @Override protected void onDestroy() { if (mFragment != null) { mFragment.closePlayer(); } YoutubeTvView view = (YoutubeTvView) findViewById(fr.bmartel.youtubetv.R.id.youtubetv_view); if (view != null) { view.stopVideo(); view.closePlayer(); } super.onDestroy(); } }
is there something I'm forgetting about?
Thanks
The text was updated successfully, but these errors were encountered:
I have the same problem. Have you found any solution?
Sorry, something went wrong.
No branches or pull requests
I'm having a probem when using this library.
When I exit the activity, I'm calling the following:
This one always return null for the view.
This is the activity I'm using:
is there something I'm forgetting about?
Thanks
The text was updated successfully, but these errors were encountered: