use of butter.droid.provider.base.model.Clip 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);
}
}
use of butter.droid.provider.base.model.Clip 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();
}
use of butter.droid.provider.base.model.Clip 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");
}
}
}
Aggregations