Flutter Video Ads Example

This Flutter Video Ads example shows how to embed ads within video playback using Flutter Ads SDK. Ideal for streaming apps, media platforms, and content-driven experiences.

Embedded video ads provide seamless monetization by integrating ads directly into video streams without disrupting user experience.

Flutter video ads example showing embedded ads in video player

Video Embedded Ad Preview

How Flutter Video Ads Work

Video ads are integrated directly into media playback. They can appear before, during, or after content, ensuring higher visibility and better engagement compared to static formats.

1. Ensure Ads Available

Ensure video ads are available before playback or insertion.


await FlutterAds.instance.ensureAdsAvailable(
    adType: AdType.videoEmbedded,
    context: context, // Required only if enableAutoFetch() has NOT been called
);

      

2. Render Video Player


// Creates a video player that automatically inserts ads
// at configured time intervals during playback.
FlutterAds.instance.getVideoPlayerWithEmbeddedAdsWidget(
  videoUrl,
  testMode: true,
  heightConstraint: MaxHeightConstraint(400),
);

      

3. Styling (Optional)

Customize overlay UI, controls, and layout behavior.


VideoEmbeddedAdStylingModel(
    logoSize: 30,
    actionStyle: TextStyle(color: Colors.white, fontSize: 10),
    footerTileStyle: AdListTileStyle(
      tileHeight: 45,
      tileTitleAlignment: MainAxisAlignment.spaceEvenly,
      tileElementsAlignment: CrossAxisAlignment.center,
      tileColor: Colors.black.withValues(alpha: 0.1),
      titleTextStyle: TextStyle(color: Colors.white, fontSize: 11),
      subtitleTextStyle: TextStyle(color: Colors.white, fontSize: 10),
    ),
    overlayColor: Colors.black.withValues(alpha: 0.1),
    onOverlayColor: Colors.white,
)

      
Place embedded ads at natural breakpoints in content for better user experience and higher completion rates.

Next Steps