Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
532
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
079d2024
Commit
079d2024
authored
3 years ago
by
Nicolas Pomepuy
Browse files
Options
Downloads
Patches
Plain Diff
Fix activity resolving for the MediaPlayer
Fixes
#2274
parent
33116907
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1210
Fix activity resolving for the MediaPlayer
Pipeline
#176234
canceled with stage
in 18 seconds
Changes
2
Pipelines
1
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 @
079d2024
...
...
@@ -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 @
079d2024
...
...
@@ -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.
Nicolas Pomepuy
@Aza
mentioned in commit
4401fdf2
·
3 years ago
mentioned in commit
4401fdf2
mentioned in commit 4401fdf2c2185b4fd92de37997e48832d027952d
Toggle commit list
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