You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The demo app contains a method createMediaSource which is not used.
I suggest using it in the PlayerManager class in the MediaSource creation so if user changes the media URL in the strings.xml
to be HLS/DASH it will not get stuck after ad playback.
Handler mainHandler = new Handler(Looper.getMainLooper());
MediaSource contentMediaSource = createMediaSource(Uri.parse(contentUrl), mainHandler, new
AdsMediaSource.EventListener() {
@override
public void onAdLoadError(IOException error) {
}
@Override
public void onAdClicked() {
}
@Override
public void onAdTapped() {
}
@Override
public void onLoadStarted(DataSpec dataSpec, int dataType, int trackType, Format trackFormat, int trackSelectionReason, Object trackSelectionData, long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs) {
}
@Override
public void onLoadCompleted(DataSpec dataSpec, int dataType, int trackType, Format trackFormat, int trackSelectionReason, Object trackSelectionData, long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs, long bytesLoaded) {
}
@Override
public void onLoadCanceled(DataSpec dataSpec, int dataType, int trackType, Format trackFormat, int trackSelectionReason, Object trackSelectionData, long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs, long bytesLoaded) {
}
@Override
public void onLoadError(DataSpec dataSpec, int dataType, int trackType, Format trackFormat, int trackSelectionReason, Object trackSelectionData, long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs, long bytesLoaded, IOException error, boolean wasCanceled) {
}
@Override
public void onUpstreamDiscarded(int trackType, long mediaStartTimeMs, long mediaEndTimeMs) {
}
@Override
public void onDownstreamFormatChanged(int trackType, Format trackFormat, int trackSelectionReason, Object trackSelectionData, long mediaTimeMs) {
}
});
The text was updated successfully, but these errors were encountered:
As of a recent change it is used for creating media sources for ad media (PlayerManager is an AdsMediaSource.MediaSourceFactory). We can also use it for creating content media sources too though, so marking this as an enhancement.
The demo app contains a method createMediaSource which is not used.
I suggest using it in the PlayerManager class in the MediaSource creation so if user changes the media URL in the strings.xml
to be HLS/DASH it will not get stuck after ad playback.
The text was updated successfully, but these errors were encountered: