Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
c36baa3b
Commit
c36baa3b
authored
May 01, 2015
by
Felix Paul Kühne
Browse files
vpc: add APIs to detect an active playback session and if it is audio-only
parent
0476d0df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Sources/VLCPlaybackController.h
View file @
c36baa3b
...
...
@@ -52,7 +52,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
@property
(
nonatomic
,
retain
)
VLCMediaList
*
mediaList
;
@property
(
nonatomic
,
readwrite
)
int
itemInMediaListToBePlayedFirst
;
/* returns nil if curren
l
ty plaing item is not a MLFile, e.g. a url */
/* returns nil if current
l
y pla
y
ing item is not a MLFile, e.g. a url */
@property
(
nonatomic
,
strong
,
readonly
)
MLFile
*
currentlyPlayingMediaFile
;
@property
(
nonatomic
,
weak
)
id
<
VLCPlaybackControllerDelegate
>
delegate
;
...
...
@@ -64,6 +64,8 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
@property
(
nonatomic
,
readwrite
)
float
playbackRate
;
@property
(
nonatomic
,
readonly
)
BOOL
currentMediaHasChapters
;
@property
(
nonatomic
,
readonly
)
BOOL
currentMediaHasTrackToChooseFrom
;
@property
(
nonatomic
,
readonly
)
BOOL
activePlaybackSession
;
@property
(
nonatomic
,
readonly
)
BOOL
audioOnlyPlaybackSession
;
+
(
VLCPlaybackController
*
)
sharedInstance
;
...
...
Sources/VLCPlaybackController.m
View file @
c36baa3b
...
...
@@ -23,6 +23,8 @@
#import <MediaPlayer/MediaPlayer.h>
#import "VLCThumbnailsCache.h"
#import <WatchKit/WatchKit.h>
#import "VLCAppDelegate.h"
#import "VLCPlaylistViewController.h"
@interface
VLCPlaybackController
()
<
AVAudioSessionDelegate
,
VLCMediaPlayerDelegate
,
VLCMediaDelegate
>
{
...
...
@@ -332,6 +334,7 @@
_mediaPlayer
.
position
=
lastPosition
;
[
self
subscribeRemoteCommands
];
[[(
VLCAppDelegate
*
)[
UIApplication
sharedApplication
].
delegate
playlistViewController
]
displayMiniPlaybackViewIfNeeded
];
_playerIsSetup
=
YES
;
}
...
...
@@ -451,6 +454,16 @@
return
[[
_mediaPlayer
audioTrackIndexes
]
count
]
>
2
||
[[
_mediaPlayer
videoSubTitlesIndexes
]
count
]
>
1
;
}
-
(
BOOL
)
activePlaybackSession
{
return
_mediaPlayer
!=
nil
;
}
-
(
BOOL
)
audioOnlyPlaybackSession
{
return
_mediaIsAudioOnly
;
}
-
(
float
)
playbackRate
{
float
f_rate
=
_mediaPlayer
.
rate
;
...
...
@@ -594,6 +607,9 @@
-
(
void
)
setVideoOutputView
:(
UIView
*
)
videoOutputView
{
if
(
videoOutputView
)
{
if
([
_actualVideoOutputView
superview
]
!=
nil
)
[
_actualVideoOutputView
removeFromSuperview
];
_mediaPlayer
.
currentVideoTrackIndex
=
0
;
_actualVideoOutputView
.
frame
=
(
CGRect
){
CGPointZero
,
videoOutputView
.
frame
.
size
};
[
_actualVideoOutputView
layoutSubviews
];
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment