How to use m3u8 format from XML VAST

1,776 views
Skip to first unread message

陳泰安

unread,
Nov 8, 2016, 3:25:40 AM11/8/16
to Interactive Media Ads SDK
Hi

First I must say IMA SDK is a great API, and it really powerful and useful.

In here I have a question to ask. Because when I change ad_tag_url, 

it alway get .MP4 type. How can I use IMA SDK to play m3u8 format ad within VAST XML?

Sorry that our url is intranet and here is our XML content:

  <?xml version="1.0" encoding="UTF-8" ?>
- <VAST version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd">
- <Ad id="38">
- <InLine>
  <AdSystem version="2.0">VOD廣告</AdSystem>
  <AdTitle>VOD廣告</AdTitle>
  <Description>描述</Description>
- <Creatives>
- <Creative sequence="1" id="38">
- <Linear>
  <Duration>00:00:30</Duration>
- <VideoClicks>
- <MediaFiles>
- <MediaFile id="1" delivery="progressive" scaleable="false" maintainAspectRatio="false" width="400" height="300" type="text/xml">
- <MediaFile id="1" delivery="streaming" scaleable="false" maintainAspectRatio="false" width="400" height="300" type="application/x-mpegURL">
- <MediaFile id="1" delivery="progressive" scaleable="false" maintainAspectRatio="false" width="400" height="300" type="video/mp4">
  </MediaFiles>
  </Linear>
  </Creative>
  </Creatives>
  </InLine>
  </Ad>
  </VAST>

Thanks a lot.

Vu Chau (IMA SDK Team)

unread,
Nov 8, 2016, 11:19:41 AM11/8/16
to Interactive Media Ads SDK
Hi there,

Which IMA SDK platform (Android, iOS, or HTML5) are you targeting?

M3U8 resources will not play on HTML5 by nature.  You can force-load your m3u8 stream for ads by passing the application/x-mpegURL mimeType to adsRenderingSettings.mimeTypes (iOS) or adsRenderingSettings.setMimeTypes (Android).  The ad video player needs to be compatible with HLS in order for this to work.  AVPlayer from our iOS sample is HLS-compatible if you want to quickly test it out.

Vu Chau
IMA SDK Team

陳泰安

unread,
Nov 8, 2016, 8:29:59 PM11/8/16
to Interactive Media Ads SDK
Hi Vu,
Thanks for reply.
Our target is Android and where I insert  this method in basic sample?
Another question I want to ask is basic sample used native player or third party player?

Vu Chau (IMA SDK Team)

unread,
Nov 9, 2016, 10:04:52 AM11/9/16
to Interactive Media Ads SDK
Hello,

Wherever you define and instantiate your adsRenderingSettings instance, you will set your mimeType preference there using adsRenderingSettings.setMimeTypes.

The video player our samples use is MediaPlayer, so it will not play HLS ad sources out of the box.  You would need another player, such as ExoPlayer.

Vu Chau
IMA SDK Team

陳泰安

unread,
Nov 9, 2016, 8:44:31 PM11/9/16
to Interactive Media Ads SDK
 
       Thanks a lot!
Reply all
Reply to author
Forward
0 new messages