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

discontinuedreplaced by: interactive_media_ads

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 Preview

ImaPlayer #

Argument Type Required Default
controller ImaPlayerController YES -
gestureRecognizer Set<Factory<OneSequenceGestureRecognizer>> NO -
autoDisposeController bool NO false

ImaPlayerController - Constructor Arguments #

Argument Type Required Default
uri String YES -
imaTag String?  NO -
headers Map<String, String>  NO <String, String>{}
options ImaPlayerOptions  NO ImaPlayerOptions()
adsLoaderSettings ImaAdsLoaderSettings  NO ImaAdsLoaderSettings()

ImaAdsLoaderSettings - Constructor Arguments #

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

ImaPlayerController - Instance members #

    /// Methods
    controller.play({String? uri}) -> Future<void>;
    controller.pause() -> Future<void>;
    controller.stop() -> Future<void>
    controller.seekTo(Duration) -> Future<void>
    controller.skipAd() -> Future<void>
    controller.setVolume(double volume) -> Future<void>
    controller.position -> Future<Duration>

    /// Observables
    controller.onAdEvent -> Stream<AdEventType>
    controller.onAdLoaded -> Stream<AdInfo>
    controller.onPlayerReady -> Future<bool>

    /// Static Properties
    ImaPlayerController.pauseAllPlayers()

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 Use native playback controllers NO false
initialVolume double initial volume, valid range 0.0 between 1.0 NO 1.0
    final controller = ImaPlayerController.network(
        '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=',
    );

    /// With Ima Player Ui
    ImaPlayerUi(
        player: ImaPlayer(controller)
    ),
    final controller = ImaPlayerController.network(
        '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: ImaPlayerOptions(
            showPlaybackControls: true, // if you want use native ui controls
        )
    );

    /// With Ima Player Ui
    AspectRatio(
        aspectRatio: 16 /9,
        child: ImaPlayer(controller)
    )

## Known issues

  • add support for assets with ImaPlayerController.asset
  • controller.skipAd not working currently.
7
likes
0
pub points
60%
popularity

Publisher

verified publishergece.dev

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

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, freezed_annotation, json_annotation, plugin_platform_interface

More

Packages that depend on ima_player