ima_player 1.1.1 copy "ima_player: ^1.1.1" to clipboard
ima_player: ^1.1.1 copied to clipboard

iOS, Android supported IMA Player. Used ExoPlayer for Android and AVPlayer for iOS.

Flutter Ima Player Plugin #

Ima Player for Android & iOS.
Used ExoPlayer SDK for Android and AVPlayer for iOS.

iOS

iOS Preview

Android

Android Preview

ImaPlayer #

Argument Type Required
controller ImaPlayerController YES
gestureRecognizer Set<Factory<OneSequenceGestureRecognizer>> NO

ImaPlayerController - Constructor Arguments #

Argument Type Required Default
videoUrl String YES -
imaTag String?  NO -
options ImaPlayerOptions  NO ImaPlayerOptions()
adsLoaderSettings ImaAdsLoaderSettings  NO ImaAdsLoaderSettings()

ImaAdsLoaderSettings - Constructor Arguments #

Argument Type Required Default
autoPlayAdBreaks bool NO true
enableDebugMode bool  NO false
language  String  NO "en"
ppid  String?  NO -

ImaPlayerController - Instance members #

    /// Methods
    controller.play({String? videoUrl}) -> Future<bool>;
    controller.pause() -> Future<bool>;
    controller.stop() -> Future<bool>
    controller.getVideoInfo() -> Future<ImaVideoInfo>
    controller.getAdInfo() -> Future<ImaAdInfo>
    controller.seekTo(Duration) -> Future<bool>
    controller.skipAd() -> Future<bool>
    controller.setVolume(double volume) -> Future<bool>

    /// Observables
    controller.onAdsEvent -> Stream<ImaAdsEvents>
    controller.onPlayerEvent -> Stream<ImaPlayerEvents>

    /// Variables
    controller.videoUrl -> String;
    controller.imaTag -> String?;
    controller.options -> ImaPlayerOptions;

ImaPlayerOptions #

Argument Type Description Required Default
muted bool NO false
autoPlay bool  NO true
isMixWithOtherMedia bool NO true
allowBackgroundPlayback bool Continue playing when app goes background  NO false
showPlaybackControls bool NO true
controllerAutoShow bool Just for android  NO true
controllerHideOnTouch bool Just for android  NO true
    final controller = ImaPlayerController(
        videoUrl: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/WeAreGoingOnBullrun.mp4',
        imaTag: 'https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=',
        options: const ImaPlayerOptions(
            autoPlay: false
        ),
    );

    /// ...
    AspectRatio(
        aspectRatio: 16 / 9,
        child: ImaPlayer(controller: controller),
    ),
    /// ...
7
likes
140
pub points
78%
popularity

Publisher

verified publishergece.dev

iOS, Android supported IMA Player. Used ExoPlayer for Android and AVPlayer for iOS.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on ima_player