FlexiMediaBanner
FlexiMediaBanner is an MIT App Inventor extension that empowers developers to create and integrate their own custom ads—multimedia banners featuring images, GIFs, and videos—directly within their apps. It offers full control over slideshows, video playlists, click events, audio playback, and URL redirection, making it easy to craft engaging promotional experiences.
Installation
- Download the com.bosonshiggs.fleximediabanner.aix (67.4 KB) file.
- In MIT App Inventor, go to Extensions > Import extension and select the downloaded file.
- Drag the FlexiMediaBanner component from the Extension palette into your project.
Properties (SimpleProperty)
1. CoverImageURL(url: String)
Displays a single image or GIF asynchronously.
Insert the block image below:
2. AudioEnabled(enabled: boolean)
Enables or disables audio playback for videos.
Insert the block image below:
AudioEnabled(true)
3. Title(text: String)
Sets the banner title text displayed below the media.
Insert the block image below:
Title("Special Offer")
4. RedirectURL(url: String)
Sets the URL to open when the banner is clicked.
Insert the block image below:
RedirectURL("https://yoururl.com")
Methods (SimpleFunction)
1. CoverImageURLs(urls: List)
Starts a slideshow of images/GIFs with a 5-second interval.
Insert the block image below:
CoverImageURLs(
make a list(
"https://ex.com/img1.png",
"https://ex.com/img2.gif",
"https://ex.com/img3.jpg"
)
)
2. VideoURL(url: String)
Plays a single video or GIF asynchronously.
Insert the block image below:
VideoURL("https://example.com/video.mp4")
3. VideoURLs(urls: List)
Plays a playlist of videos sequentially, looping back to the start after the last item.
Insert the block image below:
VideoURLs(
make a list(
"https://ex.com/vid1.mp4",
"https://ex.com/vid2.mp4"
)
)
4. AnchorTo(container: AndroidViewComponent)
Attaches the banner to the specified container.
Insert the block image below:
AnchorTo(Screen1)
5. Stop()
Stops all media playback and clears the state.
Insert the block image below:
Stop()
Events (SimpleEvent)
1. AdClicked(url: String)
Fired when the banner is clicked, returning the current media URL.
Insert the block image below:
2. ImageLoaded()
Fired when an image or GIF has loaded successfully.
Insert the block image below:
3. VideoError(message: String)
Fired when a video playback error occurs.
Insert the block image below:
4. ImageLoadError(message: String)
Fired when an image/GIF fails to load.
Insert the block image below:
License
This project is licensed under the MIT License. Feel free to use, modify, and contribute back to the community.
Support
If you have any questions or encounter issues, please open an issue on the GitHub repository or ask in the MIT App Inventor community.