Search in sources :

Example 11 with MediaWrapper

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

the class EpisodeDialogFragment method playClick.

@OnClick(R.id.play_button)
public void playClick() {
    smoothDismiss();
    // TODO parent
    UiSubItem selectedSub = this.selectedSub;
    final SubtitleWrapper subtitleWrapper;
    if (selectedSub != null) {
        subtitleWrapper = new SubtitleWrapper(selectedSub.getSubtitle());
    } else {
        subtitleWrapper = null;
    }
    // TODO use pare presenter
    StreamInfo streamInfo = new StreamInfo(selectedTorrent, new MediaWrapper(episode, mediaMeta), null, subtitleWrapper);
    ((FragmentListener) getActivity()).playStream(streamInfo);
}
Also used : MediaWrapper(butter.droid.base.providers.media.model.MediaWrapper) UiSubItem(butter.droid.ui.media.detail.model.UiSubItem) StreamInfo(butter.droid.base.providers.media.model.StreamInfo) SubtitleWrapper(butter.droid.base.providers.subs.model.SubtitleWrapper) OnClick(butterknife.OnClick)

Example 12 with MediaWrapper

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

the class ShowDetailAboutFragment method onCreate.

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

Example 13 with MediaWrapper

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

the class ShowDetailFragment method onCreate.

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

Example 14 with MediaWrapper

use of butter.droid.base.providers.media.model.MediaWrapper 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 15 with MediaWrapper

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

the class TrailerPlayerActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState, 0);
    final Intent intent = getIntent();
    final MediaWrapper media = intent.getParcelableExtra(EXTRA_MEDIA);
    final String youtubeUrl = intent.getStringExtra(EXTRA_URI);
    if (savedInstanceState == null) {
        TrailerPlayerFragment fragment = TrailerPlayerFragment.newInstance(media, youtubeUrl);
        getSupportFragmentManager().beginTransaction().add(android.R.id.content, fragment).commit();
    }
}
Also used : MediaWrapper(butter.droid.base.providers.media.model.MediaWrapper) Intent(android.content.Intent)

Aggregations

MediaWrapper (butter.droid.base.providers.media.model.MediaWrapper)26 Bundle (android.os.Bundle)7 Disposable (io.reactivex.disposables.Disposable)6 ProviderManager (butter.droid.base.manager.internal.provider.ProviderManager)4 StreamInfo (butter.droid.base.providers.media.model.StreamInfo)4 Filter (butter.droid.provider.base.filter.Filter)4 Media (butter.droid.provider.base.model.Media)4 Pager (butter.droid.provider.filter.Pager)4 MediaCardItem (butter.droid.tv.presenters.MediaCardPresenter.MediaCardItem)4 Observable (io.reactivex.Observable)4 Single (io.reactivex.Single)4 AndroidSchedulers (io.reactivex.android.schedulers.AndroidSchedulers)4 Schedulers (io.reactivex.schedulers.Schedulers)4 List (java.util.List)4 Nullable (android.support.annotation.Nullable)3 Pair (android.util.Pair)3 SubtitleWrapper (butter.droid.base.providers.subs.model.SubtitleWrapper)3 Clip (butter.droid.provider.base.model.Clip)3 Paging (butter.droid.provider.base.paging.Paging)3 SingleObserver (io.reactivex.SingleObserver)3