diff options
author | Liang Qi <liang.qi@qt.io> | 2016-12-12 09:48:13 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-12-12 10:27:59 +0100 |
commit | 533759ef333e4db8625cd02f763994788da01199 (patch) | |
tree | dcb4b4ec8882b42ce8213f4e309534dd8d234843 /src/plugins/android/jar | |
parent | 31ed506ea2c7a8be439d77e02ca0d67b6f9ce675 (diff) | |
parent | 7bc230386e0d8d6f3c4ad5a0a6a22a625c9a8327 (diff) |
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp
Change-Id: I7c30c2d13fdd07ee07e4449d5d3e256e988d3793
Diffstat (limited to 'src/plugins/android/jar')
-rw-r--r-- | src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java b/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java index 6818b2909..7fb4a8690 100644 --- a/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java +++ b/src/plugins/android/jar/src/org/qtproject/qt5/android/multimedia/QtAndroidMediaPlayer.java @@ -44,7 +44,6 @@ import java.lang.String; import java.io.FileInputStream; // API is level is < 9 unless marked otherwise. -import android.app.Activity; import android.content.Context; import android.media.MediaPlayer; import android.net.Uri; @@ -68,7 +67,7 @@ public class QtAndroidMediaPlayer private MediaPlayer mMediaPlayer = null; private Uri mUri = null; private final long mID; - private final Activity mActivity; + private final Context mContext; private boolean mMuted = false; private int mVolume = 100; private static final String TAG = "Qt MediaPlayer"; @@ -207,10 +206,10 @@ public class QtAndroidMediaPlayer } - public QtAndroidMediaPlayer(final Activity activity, final long id) + public QtAndroidMediaPlayer(final Context context, final long id) { mID = id; - mActivity = activity; + mContext = context; } private void setState(int state) @@ -363,7 +362,7 @@ public class QtAndroidMediaPlayer final boolean inAssets = (mUri.getScheme().compareTo("assets") == 0); if (inAssets) { final String asset = mUri.getPath().substring(1 /* Remove first '/' */); - final AssetManager am = mActivity.getAssets(); + final AssetManager am = mContext.getAssets(); afd = am.openFd(asset); final long offset = afd.getStartOffset(); final long length = afd.getLength(); @@ -374,7 +373,7 @@ public class QtAndroidMediaPlayer FileDescriptor fd = fis.getFD(); mMediaPlayer.setDataSource(fd); } else { - mMediaPlayer.setDataSource(mActivity, mUri); + mMediaPlayer.setDataSource(mContext, mUri); } setState(State.Initialized); } catch (final IOException e) { |