FreeWheel

Assign an Ad Schedule to a Playlist Item

To setup an ad schedule for an individual playlist item, create an AdBreak object with a specific offset and assign a list of the ad breaks to the media. Note: the FwAdvertising object must be created and the FreeWheel settings configuration provided there.

Code Example:

// Create your FreeWheel advertising settings
int networkId = 42015;
String serverId = "http://7cee0.v.fwmrm.net/";
String profileId = "fw_tutorial_android";
String sectionId = "fw_tutorial_android";
String mediaId = "fw_simple_tutorial_asset";
FwSettings settings = new FwSettings(networkId, serverId, profileId, sectionId, mediaId); 

// Create advertising object
FwAdvertising advertising = new FwAdvertising(settings);

// Construct a new AdBreak with a specific offset
// This AdBreak will play a midroll at 10%
AdBreak adBreak = new AdBreak("10%", AdSource.FW, "placeholder_string");

// Add the AdBreak to a List
List<AdBreak> schedule = new ArrayList<>();
schedule.add(adBreak);

// Build a PlaylistItem and assign the schedule
PlaylistItem video = new PlaylistItem.Builder()
                     .file("http://playertest.longtailvideo.com/adaptive/bipbop/gear4/prog_index.m3u8")
                    .adSchedule(schedule)
                    .build();

// Add the PlaylistItem to a List 
List<PlaylistItem> playlist = new ArrayList<>();
playlist.add(video);

// Build the PlayerConfig
PlayerConfig playerConfig = new PlayerConfig.Builder()
                    .playlist(playlist)
         .advertising(advertising)
                    .build();

// Setup the player
mPlayerView.setup(playerConfig);

Custom Parameters

Use the setCustomParams method of the FwSettings object to customize your FreeWheel ad request.

Code Example:

FwSettings settings = new FwSettings(networkId, serverId, profileId, sectionId, mediaId);

// Create custom parameters
Map<String, String> parameters = new HashMap<>();
parameters.put("key1", "value1");
parameters.put("key2", "value2");

settings.setCustomParams(parameters);

VPAID

No additional setup required to use VPAID. FreeWheel configuration for VPAID and VAST are the same. However, the FreeWheel campaign should be configured to use VPAID.

Unsupported Features

Postroll

Post-rolls are not supported at this time but is planned as a future addition.