PlayerController class

Controls the native iOS video player.

Create one controller per PlayerView widget. After the widget is inserted into the tree, the underlying MethodChannel is ready and all methods can be called.

Constructors

PlayerController()

Properties

eventStream Stream<PlayerEvent>
Stream of native player events (ready, playstatechange, timeupdate, …).
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addArrayBarrageText(List<String> texts, String textColor, double speed) Future<void>
addBarrageText(String text, String textColor, double speed) Future<void>
cleanBarrageQueue() Future<void>
clearBarrage() Future<void>
clearProgressMarkerPoints() Future<void>
connectDLNADevice(String deviceId) Future<void>
destroy() Future<void>
disconnectDLNADevice() Future<void>
dispose() → void
dlnaGetPositionInfo() Future<void>
dlnaGetVolume() Future<void>
dlnaPause() Future<void>
dlnaPlay() Future<void>
dlnaSeekToTime(int seconds) Future<void>
Seek DLNA device to seconds (converted to HH:MM:SS internally).
dlnaSetMute(bool muted) Future<void>
dlnaSetURL(String url) Future<void>
dlnaSetVolume(int volume) Future<void>
dlnaStartPositionPolling() Future<void>
dlnaStop() Future<void>
dlnaStopPositionPolling() Future<void>
enterFullscreen() Future<void>
enterPIP() Future<void>
exitFullscreen() Future<void>
exitPIP() Future<void>
forceOrientationToLandscape() Future<void>
forceOrientationToPortrait() Future<void>
getBrightness() Future<double>
getCurrentTime() Future<double>
Returns the current playback position in seconds.
getDLNADevices() Future<void>
getDuration() Future<double>
Returns the total duration in seconds.
getVolume() Future<double>
hideToast() Future<void>
lockOrientation(bool locked) Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() Future<void>
play(String url) Future<void>
Load and play a video URL (mp4 / m3u8 / local file path).
playWithAds({required String url, required String adsUrl, int countDown = 15}) Future<void>
Play with a pre-roll ad video before the main content.
playWithResourceLoad(String url) Future<void>
Play with HEVC resource-loader pre-processing (hev1→hvc1 fix).
resume() Future<void>
seek(double position) Future<void>
Seek to position seconds.
setBarrageRowsNumber(int rows) Future<void>
setBarrageVisible(bool visible) Future<void>
setBrightness(double brightness) Future<void>
Set screen brightness 0.0 – 1.0.
setButtonImages(Map<String, String> images) Future<void>
Set custom button images. Each key matches a button name (e.g. 'play', 'pause', 'fullscreen', …) and each value is a base-64 encoded image.
setEpisodeSelectorAd(String imageURL, String title, String subtitle) Future<void>
setLoadingGif(String base64, String text) Future<void>
setMuted(bool muted) Future<void>
setPausePopupAdURL({required String portraitURL, required String landscapeURL}) Future<void>
setPlayerTitle(String title) Future<void>
setPlayingGifImage(String base64) Future<void>
setProgressMarkerPoints(List<Map<String, dynamic>> points) Future<void>
setProgressSliderColor(String hexColor) Future<void>
setProgressSliderHeight(double height) Future<void>
setRate(double rate) Future<void>
Set playback speed (e.g. 0.5, 1.0, 1.5, 2.0).
setSeekFeedbackMode(int mode) Future<void>
mode 0 = time only, 1 = thumbnail preview, 2 = realtime seek.
setSelectorAdImage(String imageURL, String adSpaceType) Future<void>
setVideoCurrentQuality(int quality) Future<void>
setVolume(double volume) Future<void>
Set system volume 0.0 – 1.0.
showEpisodeSelector(Map<String, dynamic> config) Future<void>
showToast(String text, {String buttonText = '', String buttonColor = '#FFFFFF'}) Future<void>
startDLNADiscovery() Future<void>
stop() Future<void>
stopDLNADiscovery() Future<void>
toString() String
A string representation of this object.
inherited
updateCurrentEpisode(int episode) Future<void>

Operators

operator ==(Object other) bool
The equality operator.
inherited