Adding Listening for Video
Use the following code example below for receiving video callbacks.
Listening for Video Example
InneractiveFullscreenVideoContentController videoContentController = new InneractiveFullscreenVideoContentController();
// full screen video ad callbacks
VideoContentListener spotVideoListener = new VideoContentListener() {
@Override
public void onProgress(int totalDurationInMsec, int positionInMsec) {
Log.i(TAG, "onProgress: total time = " + totalDurationInMsec + " position = " + positionInMsec);
}
@Override
public void onCompleted() {
Log.i(TAG, "onCompleted");
}
@Override
public void onPlayerError() {
/**
* Please note that onPlayerError callback method is deprecated starting from VAMP v7.3.0,
* and won't be trigged when an error is occurred.
* Note: The SDK handles such errors internally and no further action is required.
*/
Log.i(TAG, "onPlayerError");
}
};
videoContentController.setEventsListener(spotVideoListener)
// Now add the content controller to the unit controller
InneractiveFullscreenUnitController fullscreenUnitController = (InneractiveFullscreenUnitController)mSpot.getSelectedUnitController();
fullscreenUnitController.addContentController(videoContentController);