Search in sources :

Example 11 with StreamInfo

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

the class TVLaunchActivity method navigateForward.

@Override
public void navigateForward() {
    String action = getIntent().getAction();
    Uri data = getIntent().getData();
    if (action != null && action.equals(Intent.ACTION_VIEW) && data != null) {
        String streamUrl = data.toString();
        try {
            streamUrl = URLDecoder.decode(streamUrl, "utf-8");
            final Media media = new Clip("0", streamUrl, -1, new Genre[0], -1, null, "", "", streamUrl);
            TVStreamLoadingActivity.startActivity(this, new StreamInfo(streamUrl, new MediaWrapper(media, -1), null));
            finish();
            return;
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
    }
    TVMainActivity.startActivity(this);
    finish();
}
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) UnsupportedEncodingException(java.io.UnsupportedEncodingException) Uri(android.net.Uri)

Example 12 with StreamInfo

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

the class TVStreamableDetailsFragment method startMovie.

@Override
public void startMovie(final MediaWrapper item, final Torrent torrent, final String quality) {
    // Default subtitles will be loaded
    StreamInfo info = new StreamInfo(torrent, item, null, new SubtitleWrapper());
    TVStreamLoadingActivity.startActivity(getActivity(), info);
}
Also used : StreamInfo(butter.droid.base.providers.media.model.StreamInfo) SubtitleWrapper(butter.droid.base.providers.subs.model.SubtitleWrapper)

Example 13 with StreamInfo

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

the class TVStreamLoadingActivity method onCreate.

@SuppressLint("MissingSuperCall")
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState, 0);
    StreamInfo streamInfo = getIntent().getParcelableExtra(EXTRA_STREAM_INFO);
    presenter.onCreate(streamInfo, savedInstanceState != null);
}
Also used : StreamInfo(butter.droid.base.providers.media.model.StreamInfo) SuppressLint(android.annotation.SuppressLint)

Example 14 with StreamInfo

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

the class PlayerFragment method onCreate.

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

Example 15 with StreamInfo

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

the class MainActivity method checkActions.

private void checkActions() {
    String action = getIntent().getAction();
    Uri data = getIntent().getData();
    if (action != null && action.equals(Intent.ACTION_VIEW) && data != null) {
        String streamUrl = data.toString();
        try {
            streamUrl = URLDecoder.decode(streamUrl, "UTF-8");
            // TODO: 7/29/17 Check if actual torrent
            final Media clip = new Clip("0", streamUrl, 0, new Genre[0], -1, "", "", "", streamUrl);
            StreamLoadingActivity.startActivity(this, new StreamInfo(streamUrl, new MediaWrapper(clip, -1), null));
            finish();
        } catch (UnsupportedEncodingException e) {
            // this should never happen
            Timber.d("Unknown encoding");
        }
    }
}
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) UnsupportedEncodingException(java.io.UnsupportedEncodingException) Uri(android.net.Uri)

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