Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
528
Issue boards
Milestones
Wiki
Code
Merge requests
14
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
4401fdf2
Commit
4401fdf2
authored
3 years ago
by
Nicolas Pomepuy
Browse files
Options
Downloads
Patches
Plain Diff
Fix activity resolving for the MediaPlayer
Fixes
#2274
(cherry picked from commit
079d2024
)
parent
79d173ed
No related branches found
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libvlc/src/org/videolan/libvlc/VideoHelper.java
+1
-1
1 addition, 1 deletion
libvlc/src/org/videolan/libvlc/VideoHelper.java
libvlc/src/org/videolan/libvlc/util/AndroidUtil.java
+10
-0
10 additions, 0 deletions
libvlc/src/org/videolan/libvlc/util/AndroidUtil.java
with
11 additions
and
1 deletion
libvlc/src/org/videolan/libvlc/VideoHelper.java
+
1
−
1
View file @
4401fdf2
...
...
@@ -190,7 +190,7 @@ class VideoHelper implements IVLCVout.OnNewVideoLayoutListener {
void
updateVideoSurfaces
()
{
if
(
mMediaPlayer
==
null
||
mMediaPlayer
.
isReleased
()
||
!
mMediaPlayer
.
getVLCVout
().
areViewsAttached
())
return
;
final
boolean
isPrimary
=
mDisplayManager
==
null
||
mDisplayManager
.
isPrimary
();
final
Activity
activity
=
isPrimary
&&
mVideoSurfaceFrame
.
getContext
()
instanceof
Activity
?
(
Activity
)
mVideoSurfaceFrame
.
getContext
()
:
null
;
final
Activity
activity
=
!
isPrimary
?
null
:
AndroidUtil
.
resolve
Activity
(
mVideoSurfaceFrame
.
getContext
()
)
;
int
sw
;
int
sh
;
...
...
This diff is collapsed.
Click to expand it.
libvlc/src/org/videolan/libvlc/util/AndroidUtil.java
+
10
−
0
View file @
4401fdf2
...
...
@@ -20,6 +20,9 @@
package
org.videolan.libvlc.util
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.ContextWrapper
;
import
android.net.Uri
;
import
android.os.Build
;
...
...
@@ -60,4 +63,11 @@ public class AndroidUtil {
public
static
Uri
FileToUri
(
File
file
)
{
return
Uri
.
fromFile
(
file
);
}
public
static
Activity
resolveActivity
(
Context
context
)
{
if
(
context
instanceof
Activity
)
return
(
Activity
)
context
;
if
(
context
instanceof
ContextWrapper
)
return
resolveActivity
(((
ContextWrapper
)
context
).
getBaseContext
());
return
null
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment