Android Open Source - StorySphere Video Sphere Screen






From Project

Back to project page StorySphere.

License

The source code is released under:

GNU General Public License

If you think the Android project StorySphere listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ruselabs.storysphere.tricks;
/*from   www .ja v  a  2 s . co m*/
import android.content.Context;
import android.media.MediaPlayer;
import android.net.Uri;

import rajawali.Object3D;
import rajawali.materials.Material;
import rajawali.materials.textures.ATexture;
import rajawali.materials.textures.VideoTexture;
import rajawali.primitives.Sphere;

/**
 * Created by davidbrodsky on 10/5/14.
 */
public class VideoSphereScreen {

    Sphere mVideoScreen;
//    AlphaVideoTexture mVideoTexture;
    VideoTexture mVideoTexture;
    Material mVideoMaterial;
    MediaPlayer mMediaPlayer;


    public VideoSphereScreen(Context context, String movieUri, int radius, double x, double y, double z) {
        try {
            mMediaPlayer = MediaPlayer.create(context, Uri.parse(movieUri));
            mMediaPlayer.setLooping(true);
            mMediaPlayer.start();
            mVideoTexture = new VideoTexture("video", mMediaPlayer);

            mVideoScreen = new Sphere(radius, 24, 24);
            mVideoScreen.setPosition(x, y, z);
            mVideoScreen.setRotY(90);
            mVideoScreen.setDoubleSided(true);
            mVideoMaterial = new Material();
            mVideoMaterial.addTexture(mVideoTexture);
            mVideoMaterial.setColorInfluence(0f);
            mVideoScreen.setMaterial(mVideoMaterial);

        } catch (ATexture.TextureException e) {
            e.printStackTrace();
        }
    }

    public Object3D getScreen() {
        return mVideoScreen;
    }

    public void advanceFrame() {
        mVideoTexture.update();
    }
}




Java Source Code List

com.ruselabs.storysphere.activities.ARActivity.java
com.ruselabs.storysphere.activities.StorySphereActivity.java
com.ruselabs.storysphere.renderer.StorySphereRenderer.java
com.ruselabs.storysphere.tricks.CameraScreen.java
com.ruselabs.storysphere.tricks.ChromaVideoScreen.java
com.ruselabs.storysphere.tricks.PhotosphereBlender.java
com.ruselabs.storysphere.tricks.VideoScreen.java
com.ruselabs.storysphere.tricks.VideoSphereScreen.java