java.lang.Object | |
↳ | com.smartadserver.android.instreamsdk.admanager.SVSAdManager |
The SVSAdManager
is the class responsible for loading ads and displaying them into the ad player.
This class is instantiated with a SVSAdPlacement
, a set of SVSAdRule
, a SVSAdPlayerConfiguration
object
and is started with an Object implementing the SVSContentPlayerPlugin
interface that makes the connection with the
content player
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | SVSAdManager.AdBreakEventListener |
This interface is deprecated.
ad break events can now be monitored via SVSAdManager.AdManagerListener
|
|||||||||
interface | SVSAdManager.AdManagerListener | Interface for Objects that will monitor SVSAdManager main events and actions | |||||||||
interface | SVSAdManager.UIInteractionListener | Interface for Objects that will respond to interactions with the ad player controls (like enter fullscreen/ exit fullscreen requests for now) |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SVSAdManager(Context context, SVSAdPlacement placement, SVSAdRule[] adRules, SVSAdPlayerConfiguration adPlayerConfiguration, SVSContentData contentData)
Main constructor
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addAdBreakEventListener(SVSAdManager.AdBreakEventListener listener)
This method is deprecated.
use
addAdManagerListener(AdManagerListener) instead
| ||||||||||
void |
addAdManagerListener(SVSAdManager.AdManagerListener listener)
Add a
SVSAdManager.AdManagerListener to this SVSAdManager
| ||||||||||
void |
addUIInteractionListener(SVSAdManager.UIInteractionListener listener)
Adds a
SVSAdManager.UIInteractionListener to this SVSAdManager. | ||||||||||
synchronized void |
cancelAdLoading()
Cancel any pending ad loading process
| ||||||||||
SVSAdPlacement |
getAdPlacement()
Returns the
SVSAdPlacement instance associated with this SVSAdManager instance
| ||||||||||
SVSAdPlayerConfiguration |
getAdPlayerConfiguration()
Returns the current
SVSAdPlayerConfiguration in use | ||||||||||
double | getPlayheadPosition() | ||||||||||
void |
notifyContentHasCompleted()
Manually notifies the
SVSAdManager instance that the content has reached its end (in
case it can not be properly detected internally)
| ||||||||||
void | onAdPlaybackClickThroughEvent(String url) | ||||||||||
void | onAdPlaybackEvent(SVSAdPlaybackEvent event) | ||||||||||
synchronized void |
onDestroy()
Releases resources allocated by this
SVSAdManager . | ||||||||||
void |
onFullscreenStateChange(boolean isFullscreen)
Tells the ad manager that your content player entered / exited fullscreen mode.
| ||||||||||
void |
onPause()
Notifies this
SVSAdManager that the hosting Activity's onPause() method was called
| ||||||||||
void |
onResume()
Notifies this
SVSAdManager that the hosting Activity's onResume() method was called
| ||||||||||
void |
removeAdBreakEventListener(SVSAdManager.AdBreakEventListener listener)
This method is deprecated.
use
removeAdManagerListener(AdManagerListener) instead
| ||||||||||
void |
removeAdManagerListener(SVSAdManager.AdManagerListener listener)
Add a
SVSAdManager.AdManagerListener to this SVSAdManager
| ||||||||||
void |
removeUIInteractionListener(SVSAdManager.UIInteractionListener listener)
Removes a
SVSAdManager.UIInteractionListener from this SVSAdManager. | ||||||||||
void |
replay()
Tells the ad manager that your content is being replayed (after being completed).
| ||||||||||
void |
resumeContent()
Will resume the content monitoring.
| ||||||||||
void |
setCreativeMediaURIProvider(SVSMediaURIProvider provider)
Sets the
SVSMediaURIProvider object used to determine the URI of the actual media to play
for a given VAST media url (for media caching for instance)
| ||||||||||
synchronized void |
start(SVSContentPlayerPlugin contentPlayerPlugin)
Starts the ad playback process on the content player represented by the
SVSContentPlayerPlugin object | ||||||||||
void |
startAdBreak()
Will start the waiting ad break, if any.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Main constructor
context | the Android Context to attach to |
---|---|
placement | the SVSAdPlacement identifying this inventory item |
adRules | an array of SVSAdRule instances that determines the ad playback configuration depending on the content properties |
adPlayerConfiguration | the SVSAdPlayerConfiguration object containing ad playback parameters |
contentData | an optional SVSContentData object containing properties about the content video |
IllegalArgumentException | thrown if any of the parameters is incorrect |
---|
This method is deprecated.
use addAdManagerListener(AdManagerListener)
instead
Add a SVSAdManager.AdBreakEventListener
to this SVSAdManager
Add a SVSAdManager.AdManagerListener
to this SVSAdManager
Adds a SVSAdManager.UIInteractionListener
to this SVSAdManager.
listener | an SVSAdManager.UIInteractionListener instance.
|
---|
Cancel any pending ad loading process
Returns the SVSAdPlacement
instance associated with this SVSAdManager
instance
Returns the current SVSAdPlayerConfiguration
in use
Manually notifies the SVSAdManager
instance that the content has reached its end (in
case it can not be properly detected internally)
Releases resources allocated by this SVSAdManager
.
Should be called only when the SVSAdManager
instance is no longer needed, as it will not
accept any further calls.
Tells the ad manager that your content player entered / exited fullscreen mode.
The ad player view will always stick to your container view even when you resize or rotate it. However, the ad manager needs to know about your fullscreen status to keep the fullscreen button status up to date when playing ad breaks. This is particularly important if your application responds to orientation changes by entering / exiting fullscreen.
isFullscreen | Whether or not the content player is in fullscreen mode. |
---|
Notifies this SVSAdManager
that the hosting Activity's onPause() method was called
Notifies this SVSAdManager
that the hosting Activity's onResume() method was called
This method is deprecated.
use removeAdManagerListener(AdManagerListener)
instead
Add a SVSAdManager.AdBreakEventListener
to this SVSAdManager
Add a SVSAdManager.AdManagerListener
to this SVSAdManager
Removes a SVSAdManager.UIInteractionListener
from this SVSAdManager.
listener | an SVSAdManager.UIInteractionListener instance.
|
---|
Tells the ad manager that your content is being replayed (after being completed). You should make sure your content player seeks to the beginning of the content video before calling this method.
This will reset the status of preroll and postroll advertisements so they can be served again. Note: this method has no impact on midroll advertisements. They will continue playing according to the appropriate ad rule and content plugin status.
Will resume the content monitoring. To use only if you have disable the adbreak autoplay. Warnings: if you do not call this method, the ad break will never fully end and the SDK will be paused waiting for this method call. More information in the official documentation.
Sets the SVSMediaURIProvider
object used to determine the URI of the actual media to play
for a given VAST media url (for media caching for instance)
Starts the ad playback process on the content player represented by the SVSContentPlayerPlugin
object
contentPlayerPlugin | the Object implementing the SVSContentPlayerPlugin interface
|
---|
IllegalArgumentException | |
---|---|
IllegalStateException |
Will start the waiting ad break, if any. To use only if you have disable the adbreak autoplay. Warnings: if you do not call this method, the ad break will never start and the SDK will be paused waiting for this method call. More information in the official documentation.