11package org .schabi .newpipe ;
22
33import android .content .ContentProviderOperation ;
4+ import android .preference .PreferenceManager ;
45import android .support .v7 .app .ActionBar ;
56import android .support .v7 .app .AppCompatActivity ;
67import android .content .Intent ;
1617
1718/**
1819 * Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
19- * ActionBarHandler .java is part of NewPipe.
20+ * VideoItemDetailActivity .java is part of NewPipe.
2021 *
2122 * NewPipe is free software: you can redistribute it and/or modify
2223 * it under the terms of the GNU General Public License as published by
@@ -60,8 +61,7 @@ protected void onCreate(Bundle savedInstanceState) {
6061
6162 Bundle arguments = new Bundle ();
6263 if (savedInstanceState == null ) {
63- // Create the detail fragment and add it to the activity
64- // using a fragment transaction.
64+ // this means the video was called though another app
6565 if (getIntent ().getData () != null ) {
6666 videoUrl = getIntent ().getData ().toString ();
6767 StreamingService [] serviceList = ServiceList .getServices ();
@@ -81,13 +81,18 @@ protected void onCreate(Bundle savedInstanceState) {
8181 }
8282 arguments .putString (VideoItemDetailFragment .VIDEO_URL ,
8383 extractor .getVideoUrl (extractor .getVideoId (videoUrl )));
84-
84+ arguments .putBoolean (VideoItemDetailFragment .AUTO_PLAY ,
85+ PreferenceManager .getDefaultSharedPreferences (this )
86+ .getBoolean (getString (R .string .autoPlayThroughIntent ), false ));
8587 } else {
8688 videoUrl = getIntent ().getStringExtra (VideoItemDetailFragment .VIDEO_URL );
8789 currentStreamingService = getIntent ().getIntExtra (VideoItemDetailFragment .STREAMING_SERVICE , -1 );
8890 arguments .putString (VideoItemDetailFragment .VIDEO_URL , videoUrl );
8991 arguments .putInt (VideoItemDetailFragment .STREAMING_SERVICE , currentStreamingService );
92+ arguments .putBoolean (VideoItemDetailFragment .AUTO_PLAY , false );
9093 }
94+ // Create the detail fragment and add it to the activity
95+ // using a fragment transaction.
9196 VideoItemDetailFragment fragment = new VideoItemDetailFragment ();
9297 fragment .setArguments (arguments );
9398 getSupportFragmentManager ().beginTransaction ()
0 commit comments