Search in sources :

Example 1 with StreamInfo

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

the class TVShowDetailPresenterImpl method startTorrent.

private void startTorrent(final MediaWrapper episode, final Torrent torrent) {
    // Load default subtitles
    StreamInfo info = new StreamInfo(torrent, episode, item, new SubtitleWrapper());
    view.torrentSelected(info);
}
Also used : StreamInfo(butter.droid.base.providers.media.model.StreamInfo) SubtitleWrapper(butter.droid.base.providers.subs.model.SubtitleWrapper)

Example 2 with StreamInfo

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

the class StreamLoadingActivity method onCreate.

@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@Override
public void onCreate(Bundle savedInstanceState) {
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
    getWindow().setBackgroundDrawableResource(R.color.bg);
    super.onCreate(savedInstanceState, 0);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    if (!getIntent().hasExtra(EXTRA_INFO)) {
        finish();
    }
    StreamInfo info = getIntent().getParcelableExtra(EXTRA_INFO);
    presenter.onCreate(info, savedInstanceState != null);
}
Also used : StreamInfo(butter.droid.base.providers.media.model.StreamInfo) TargetApi(android.annotation.TargetApi)

Example 3 with StreamInfo

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

the class VideoPlayerActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState, 0);
    setShowCasting(true);
    Intent intent = getIntent();
    Bundle extras = intent.getExtras();
    StreamInfo streamInfo = extras.getParcelable(EXTRA_STREAM_INFO);
    long resumePosition = extras.getLong(EXTRA_RESUME_POSITION, 0);
    if (savedInstanceState == null) {
        presenter.onCreate(streamInfo, resumePosition, intent.getAction(), intent);
    } else {
        fragment = (PlayerFragment) getSupportFragmentManager().findFragmentByTag(TAG_VIDEO_FRAGMENT);
    }
}
Also used : Bundle(android.os.Bundle) StreamInfo(butter.droid.base.providers.media.model.StreamInfo) Intent(android.content.Intent)

Example 4 with StreamInfo

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

the class MediaDetailPresenterImpl method playMediaClicked.

@Override
public void playMediaClicked() {
    if (preferencesHandler.wifiOnly() && !networkManager.isWifiConnected() && !networkManager.isEthernetConnected() && networkManager.isNetworkConnected()) {
        view.displayDialog(R.string.wifi_only, R.string.wifi_only_message);
    } else {
        StreamInfo streamInfo = new StreamInfo(selectedTorrent, media, null, subtitle);
        view.playStream(streamInfo);
    }
}
Also used : StreamInfo(butter.droid.base.providers.media.model.StreamInfo)

Example 5 with StreamInfo

use of butter.droid.base.providers.media.model.StreamInfo 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)

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