[Android] Remember video playback speed when set

Geoffrey Métais git at videolan.org
Mon Mar 14 14:02:15 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Mar 14 13:56:39 2016 +0100| [8180f9d25c0da3347b82f871d32715215ab6b30b] | committer: Geoffrey Métais

Remember video playback speed when set

> https://code.videolan.org/videolan/vlc-android/commit/8180f9d25c0da3347b82f871d32715215ab6b30b
---

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 68b6da2..9427830 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -722,6 +722,10 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
 
         loadMedia();
 
+        int ratePref = Integer.valueOf(mSettings.getString(PreferencesActivity.VIDEO_SAVE_SPEED, "0"));
+        if (ratePref == 2)
+            mService.setRate(mSettings.getFloat(PreferencesActivity.VIDEO_RATE, 1.0f));
+
         // Add any selected subtitle file from the file picker
         if(mSubtitleSelectedFiles.size() > 0) {
             for(String file : mSubtitleSelectedFiles) {
@@ -867,7 +871,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             } catch(IOException e) {}
         }
         editor.putString(PreferencesActivity.VIDEO_SUBTITLE_FILES, subtitleList_serialized);
-        mService.setRate(1.0f);
+
+        int ratePref = Integer.valueOf(mSettings.getString(PreferencesActivity.VIDEO_SAVE_SPEED, "0"));
+        if (ratePref == 2)
+            editor.putFloat(PreferencesActivity.VIDEO_RATE, mService.getRate());
+        else if (ratePref == 0)
+            mService.setRate(1.0f);
 
         Util.commitPreferences(editor);
     }



More information about the Android mailing list