Search in sources :

Example 6 with StreamInfo

use of butter.droid.base.providers.media.model.StreamInfo in project butter-android by butterproject.

the class StreamLoadingFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    StreamInfo streamInfo = getArguments().getParcelable(ARGS_STREAM_INFO);
    presenter.onCreate(streamInfo);
}
Also used : StreamInfo(butter.droid.base.providers.media.model.StreamInfo)

Example 7 with StreamInfo

use of butter.droid.base.providers.media.model.StreamInfo in project butter-android by butterproject.

the class VideoPlayerPresenterImpl method onCreate.

@Override
public void onCreate(final StreamInfo streamInfo, final long resumePosition, final String action, final Intent intent) {
    if (Intent.ACTION_VIEW.equals(action)) {
        String videoLocation = StreamInfoUtils.getActionViewVideoLocation(contentResolver, intent);
        if (videoLocation != null) {
            final Media media = new Clip("0", videoLocation, -1, new Genre[0], -1, "", "", "", videoLocation);
            this.streamInfo = new StreamInfo(videoLocation, new MediaWrapper(media, -1), null);
            this.resumePosition = intent.getLongExtra("position", 0);
            view.showVideoFragment(this.streamInfo, this.resumePosition);
        } else {
        // TODO: 4/2/17 Show error
        }
    } else {
        this.streamInfo = streamInfo;
        this.resumePosition = resumePosition;
        if (streamInfo == null) {
            throw new IllegalStateException("StreamInfo has to be provided");
        }
        view.showVideoFragment(streamInfo, resumePosition);
    }
}
Also used : Clip(butter.droid.provider.base.model.Clip) MediaWrapper(butter.droid.base.providers.media.model.MediaWrapper) Media(butter.droid.provider.base.model.Media) StreamInfo(butter.droid.base.providers.media.model.StreamInfo)

Example 8 with StreamInfo

use of butter.droid.base.providers.media.model.StreamInfo in project butter-android by butterproject.

the class BeamPlayerFragment method onCreate.

@Override
public void onCreate(@Nullable final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    loadingDialog = LoadingBeamingDialogFragment.newInstance();
    loadingDialog.setOnCancelListener(dialogInterface -> presenter.closePlayer());
    loadingDialog.show(getChildFragmentManager(), "overlay_fragment");
    Bundle arguments = getArguments();
    StreamInfo streamInfo = arguments.getParcelable(ARG_STREAM_INFO);
    long resumePosition = getArguments().getLong(ARG_RESUME_POSITION);
    presenter.onCreate(streamInfo, resumePosition);
}
Also used : Bundle(android.os.Bundle) StreamInfo(butter.droid.base.providers.media.model.StreamInfo)

Example 9 with StreamInfo

use of butter.droid.base.providers.media.model.StreamInfo in project butter-android by butterproject.

the class TVStreamLoadingFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle arguments = getArguments();
    StreamInfo streamInfo = arguments.getParcelable(ARGS_STREAM_INFO);
    presenter.onCreate(streamInfo);
}
Also used : Bundle(android.os.Bundle) StreamInfo(butter.droid.base.providers.media.model.StreamInfo)

Example 10 with StreamInfo

use of butter.droid.base.providers.media.model.StreamInfo in project butter-android by butterproject.

the class TVPlayerFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    StreamInfo streamInfo = getArguments().getParcelable(ARG_STREAM_INFO);
    long resumePosition = getResumePosition(savedInstanceState);
    // stateBuilder.addCustomAction(PlayerMediaControllerGlue.ACTION_CLOSE_CAPTION, getString(R.string.subtitles),
    // R.drawable.ic_av_subs);g
    presenter.onCreate(streamInfo, resumePosition);
}
Also used : StreamInfo(butter.droid.base.providers.media.model.StreamInfo)

Aggregations

StreamInfo (butter.droid.base.providers.media.model.StreamInfo)16 MediaWrapper (butter.droid.base.providers.media.model.MediaWrapper)4 Bundle (android.os.Bundle)3 SubtitleWrapper (butter.droid.base.providers.subs.model.SubtitleWrapper)3 Clip (butter.droid.provider.base.model.Clip)3 Media (butter.droid.provider.base.model.Media)3 Uri (android.net.Uri)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 SuppressLint (android.annotation.SuppressLint)1 TargetApi (android.annotation.TargetApi)1 Intent (android.content.Intent)1 UiSubItem (butter.droid.ui.media.detail.model.UiSubItem)1 OnClick (butterknife.OnClick)1