11package org .schabi .newpipe ;
22
3- import android .app .DownloadManager ;
43import android .content .Context ;
54import android .content .DialogInterface ;
65import android .content .Intent ;
76import android .content .SharedPreferences ;
87import android .net .Uri ;
98import android .os .Bundle ;
10- import android .preference .Preference ;
119import android .preference .PreferenceManager ;
1210import android .support .v4 .view .MenuItemCompat ;
1311import android .support .v7 .app .ActionBar ;
1917import android .view .MenuItem ;
2018import android .widget .ArrayAdapter ;
2119
22- import java .io .File ;
23-
2420/**
2521 * Created by Christian Schabesberger on 18.08.15.
2622 *
@@ -48,7 +44,7 @@ public class ActionBarHandler {
4844 private static ActionBarHandler handler = null ;
4945
5046 private Context context = null ;
51- private String webisteUrl = "" ;
47+ private String websiteUrl = "" ;
5248 private AppCompatActivity activity ;
5349 private VideoInfo .VideoStream [] videoStreams = null ;
5450 private VideoInfo .AudioStream audioStream = null ;
@@ -64,7 +60,7 @@ public static ActionBarHandler getHandler() {
6460 return handler ;
6561 }
6662
67- class ForamatItemSelectListener implements ActionBar .OnNavigationListener {
63+ class FormatItemSelectListener implements ActionBar .OnNavigationListener {
6864 @ Override
6965 public boolean onNavigationItemSelected (int itemPosition , long itemId ) {
7066 selectFormatItem ((int )itemId );
@@ -98,7 +94,7 @@ public void setStreams(VideoInfo.VideoStream[] videoStreams, VideoInfo.AudioStre
9894 if (activity != null ) {
9995 ActionBar ab = activity .getSupportActionBar ();
10096 ab .setListNavigationCallbacks (itemAdapter
101- ,new ForamatItemSelectListener ());
97+ ,new FormatItemSelectListener ());
10298 ab .setSelectedNavigationItem (defaultResolutionPos );
10399 }
104100
@@ -114,9 +110,9 @@ public void setStreams(VideoInfo.VideoStream[] videoStreams, VideoInfo.AudioStre
114110 }
115111 } else if (preferedFormat .equals ("m4a" )){
116112 for (VideoInfo .AudioStream s : audioStreams ) {
117- Log .d (TAG , VideoInfo .getMimeById (s .format ) + " : " + Integer .toString (s .bandWidth ));
113+ Log .d (TAG , VideoInfo .getMimeById (s .format ) + " : " + Integer .toString (s .bandwidth ));
118114 if (s .format == VideoInfo .I_M4A &&
119- (audioStream == null || audioStream .bandWidth > s .bandWidth )) {
115+ (audioStream == null || audioStream .bandwidth > s .bandwidth )) {
120116 audioStream = s ;
121117 Log .d (TAG , "last choosen" );
122118 }
@@ -162,7 +158,7 @@ public boolean onItemSelected(MenuItem item, Context context) {
162158 if (!videoTitle .isEmpty ()) {
163159 Intent intent = new Intent ();
164160 intent .setAction (Intent .ACTION_SEND );
165- intent .putExtra (Intent .EXTRA_TEXT , webisteUrl );
161+ intent .putExtra (Intent .EXTRA_TEXT , websiteUrl );
166162 intent .setType ("text/plain" );
167163 context .startActivity (Intent .createChooser (intent , context .getString (R .string .shareDialogTitle )));
168164 }
@@ -192,7 +188,7 @@ public boolean onItemSelected(MenuItem item, Context context) {
192188 }
193189
194190 public void setVideoInfo (String websiteUrl , String videoTitle ) {
195- this .webisteUrl = websiteUrl ;
191+ this .websiteUrl = websiteUrl ;
196192 this .videoTitle = videoTitle ;
197193 }
198194
@@ -239,7 +235,7 @@ public void onClick(DialogInterface dialog, int which) {
239235 Intent intent = new Intent (context , PlayVideoActivity .class );
240236 intent .putExtra (PlayVideoActivity .VIDEO_TITLE , videoTitle );
241237 intent .putExtra (PlayVideoActivity .STREAM_URL , videoStreams [selectedStream ].url );
242- intent .putExtra (PlayVideoActivity .VIDEO_URL , webisteUrl );
238+ intent .putExtra (PlayVideoActivity .VIDEO_URL , websiteUrl );
243239 context .startActivity (intent );
244240 }
245241 }
@@ -267,7 +263,7 @@ public void openInBrowser() {
267263 if (!videoTitle .isEmpty ()) {
268264 Intent intent = new Intent ();
269265 intent .setAction (Intent .ACTION_VIEW );
270- intent .setData (Uri .parse (webisteUrl ));
266+ intent .setData (Uri .parse (websiteUrl ));
271267
272268 context .startActivity (Intent .createChooser (intent , context .getString (R .string .chooseBrowser )));
273269 }
@@ -278,7 +274,7 @@ public void playWithKodi() {
278274 try {
279275 Intent intent = new Intent (Intent .ACTION_VIEW );
280276 intent .setPackage (KORE_PACKET );
281- intent .setData (Uri .parse (webisteUrl .replace ("https" , "http" )));
277+ intent .setData (Uri .parse (websiteUrl .replace ("https" , "http" )));
282278 context .startActivity (intent );
283279 } catch (Exception e ) {
284280 e .printStackTrace ();
0 commit comments