You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.
Hi, i was looking for a way to play remote content. It's seems to be disabled on propouse, no?
I'm working with the vr360 project as suggested and changed the function like the following.
Is this right, or maybe there is some problem with remote content? Thanks
@Override
protected Void doInBackground(Intent... intent) {
// Extract the stereoFormat from the Intent's extras.
int stereoFormat = intent[0].getIntExtra("stereoFormat", Mesh.MEDIA_MONOSCOPIC);
if (stereoFormat != Mesh.MEDIA_STEREO_LEFT_RIGHT && stereoFormat != Mesh.MEDIA_STEREO_TOP_BOTTOM) {
stereoFormat = Mesh.MEDIA_MONOSCOPIC;
}
// Create video sphere
mesh = Mesh.createUvSphere(
SPHERE_RADIUS_METERS, DEFAULT_SPHERE_ROWS,
DEFAULT_SPHERE_COLUMNS, DEFAULT_SPHERE_VERTICAL_DEGREES,
DEFAULT_SPHERE_HORIZONTAL_DEGREES, stereoFormat
);
// Based on the Intent's data, load the appropriate media from disk.
String media_url = intent[0].getStringExtra("src");
Uri uri = Uri.parse(media_url);
try {
File file = new File(uri.getPath());
String type = URLConnection.guessContentTypeFromName(uri.getPath());
if (type == null) {
throw new InvalidParameterException("Unknown file type: " + uri);
} else if (type.startsWith("image")) {
if (file.exists()) {
mediaImage = BitmapFactory.decodeFile(uri.getPath());
} else {
mediaImage = BitmapFactory.decodeStream(new java.net.URL(media_url).openStream());
}
} else if (type.startsWith("video")) {
MediaPlayer mp = MediaPlayer.create(context, uri);
synchronized (MediaLoader.this) {
mediaPlayer = mp;
}
} else {
throw new InvalidParameterException("Unsupported MIME type: " + type);
}
} catch (IOException | InvalidParameterException e) {
errorText = String.format("Error loading file [%s]: %s", uri.getPath(), e);
Log.e(TAG, errorText);
}
displayWhenReady();
return null;
}
The text was updated successfully, but these errors were encountered:
This may be a compatibility issue with the video stream format and the default Media Player. The sample was primarily designed to demonstrate the VR rendering aspects and not the video playback functionality. Instead of using Android's MediaPlayer, the general recommendation for video playback on Android is to use a more powerful player like https://github.com/google/ExoPlayer which has better format compatibility.
Hi, i was looking for a way to play remote content. It's seems to be disabled on propouse, no?
I'm working with the vr360 project as suggested and changed the function like the following.
Is this right, or maybe there is some problem with remote content? Thanks
The text was updated successfully, but these errors were encountered: