app/src/main/java/fi/finwe/orion360/sdk/pro/examples/gallery/ThumbnailPager.java
protected void initVideoPlayer() {

        // Create a new scene. This represents a 3D world where various objects can be placed.
        mVideoPlayerScene = new OrionScene();

        // Bind sensor fusion as a controller. This will make it available for scene objects.
        mVideoPlayerScene.bindController(mOrionContext.getSensorFusion());

        // Bind the touch controller widget to the scene. This will make it functional in the scene.
        mVideoPlayerScene.bindWidget(mTouchController);

        // Create a new panorama. This is a 3D object that will represent a spherical video/image.
        mVideoCanvas = new OrionPanorama();

        // Notice: we will create and bind video texture later, when user chooses the video.

        // Bind the panorama to the scene. This will make it part of our 3D world.
        mVideoPlayerScene.bindSceneItem(mVideoCanvas);

        // Create video player 'home' button for returning to gallery, and bind it to the scene.
        mHomeButton = new SelectablePointerIcon();
        mHomeButton.setLocationPolarZXYDeg(0.0f, -65.0f, 0.0f, 0.7f);
        mHomeButton.setScale(0.1f, 0.15f);
        mHomeButton.getIcon().bindTexture(OrionTexture.createTextureFromURI(this,
                getString(R.string.asset_icon_home)));
        mHomeButton.getIcon().setAmpAlpha(0.70f);
        mHomeButton.getPieSprite().bindTexture(OrionTexture.createTextureFromURI(this,
                getString(R.string.asset_icon_home)));
        mHomeButton.setPointer(mCamera);
        mHomeButton.setSelectionTriggerFrameCount(90);
        mHomeButton.setUiThreadListener(new SelectablePointerIcon.Listener() {

            @Override
            public void onSelectionTrigger() {
                Log.d(TAG, "Home button triggered");

                // We are returning from video player to gallery, clean up video texture.
                if (null != mVideoCanvasTexture) {
                    mVideoCanvasTexture.pause();
                    mVideoCanvas.releaseTexture(0);
                    mVideoCanvasTexture.destroy();
                }

                // Switch from video player scene to gallery scene.
                OrionViewport viewport = mView.getViewports()[0];
                viewport.releaseScene();
                viewport.bindScene(mGalleryScene);
            }

            @Override
            public void onSelectionFocusLost() {
                Log.d(TAG, "Home button focus lost");
            }

            @Override
            public void onSelectionFocusGained() {
                Log.d(TAG, "Home button focus gained");
            }

        });
        mVideoPlayerScene.bindWidget(mHomeButton);
    }
/**
     * Initializes Orion360 video player components.
     */
Initializes Orion360 video player components.
Initializes Orion360 video player components .
protected void initVideoPlayer() {
        mVideoPlayerScene = new OrionScene();
        mVideoPlayerScene.bindController(mOrionContext.getSensorFusion());
        mVideoPlayerScene.bindWidget(mTouchController);
        mVideoCanvas = new OrionPanorama();
        mVideoPlayerScene.bindSceneItem(mVideoCanvas);
        mHomeButton = new SelectablePointerIcon();
        mHomeButton.setLocationPolarZXYDeg(0.0f, -65.0f, 0.0f, 0.7f);
        mHomeButton.setScale(0.1f, 0.15f);
        mHomeButton.getIcon().bindTexture(OrionTexture.createTextureFromURI(this,
                getString(R.string.asset_icon_home)));
        mHomeButton.getIcon().setAmpAlpha(0.70f);
        mHomeButton.getPieSprite().bindTexture(OrionTexture.createTextureFromURI(this,
                getString(R.string.asset_icon_home)));
        mHomeButton.setPointer(mCamera);
        mHomeButton.setSelectionTriggerFrameCount(90);
        mHomeButton.setUiThreadListener(new SelectablePointerIcon.Listener() {
            @Override
            public void onSelectionTrigger() {
                Log.d(TAG, "Home button triggered");
                if (null != mVideoCanvasTexture) {
                    mVideoCanvasTexture.pause();
                    mVideoCanvas.releaseTexture(0);
                    mVideoCanvasTexture.destroy();
                }
                OrionViewport viewport = mView.getViewports()[0];
                viewport.releaseScene();
                viewport.bindScene(mGalleryScene);
            }
            @Override
            public void onSelectionFocusLost() {
                Log.d(TAG, "Home button focus lost");
            }
            @Override
            public void onSelectionFocusGained() {
                Log.d(TAG, "Home button focus gained");
            }
        });
        mVideoPlayerScene.bindWidget(mHomeButton);
    }
protected void initVideoPlayer ( ) { mVideoPlayerScene = new OrionScene ( ) ; mVideoPlayerScene . bindController ( mOrionContext . getSensorFusion ( ) ) ; mVideoPlayerScene . bindWidget ( mTouchController ) ; mVideoCanvas = new OrionPanorama ( ) ; mVideoPlayerScene . bindSceneItem ( mVideoCanvas ) ; mHomeButton = new SelectablePointerIcon ( ) ; mHomeButton . setLocationPolarZXYDeg ( 0.0f , - 65.0f , 0.0f , 0.7f ) ; mHomeButton . setScale ( 0.1f , 0.15f ) ; mHomeButton . getIcon ( ) . bindTexture ( OrionTexture . createTextureFromURI ( this , getString ( R . string . asset_icon_home ) ) ) ; mHomeButton . getIcon ( ) . setAmpAlpha ( 0.70f ) ; mHomeButton . getPieSprite ( ) . bindTexture ( OrionTexture . createTextureFromURI ( this , getString ( R . string . asset_icon_home ) ) ) ; mHomeButton . setPointer ( mCamera ) ; mHomeButton . setSelectionTriggerFrameCount ( 90 ) ; mHomeButton . setUiThreadListener ( new SelectablePointerIcon . Listener ( ) { @ Override public void onSelectionTrigger ( ) { Log . d ( TAG , "Home button triggered" ) ; if ( null != mVideoCanvasTexture ) { mVideoCanvasTexture . pause ( ) ; mVideoCanvas . releaseTexture ( 0 ) ; mVideoCanvasTexture . destroy ( ) ; } OrionViewport viewport = mView . getViewports ( ) [ 0 ] ; viewport . releaseScene ( ) ; viewport . bindScene ( mGalleryScene ) ; } @ Override public void onSelectionFocusLost ( ) { Log . d ( TAG , "Home button focus lost" ) ; } @ Override public void onSelectionFocusGained ( ) { Log . d ( TAG , "Home button focus gained" ) ; } } ) ; mVideoPlayerScene . bindWidget ( mHomeButton ) ; }
Initializes Orion360 video player components.
Initializes Orion360 video player components .
// Create a new scene. This represents a 3D world where various objects can be placed. // Bind sensor fusion as a controller. This will make it available for scene objects. // Bind the touch controller widget to the scene. This will make it functional in the scene. // Create a new panorama. This is a 3D object that will represent a spherical video/image. // Notice: we will create and bind video texture later, when user chooses the video. // Bind the panorama to the scene. This will make it part of our 3D world. // Create video player 'home' button for returning to gallery, and bind it to the scene. // We are returning from video player to gallery, clean up video texture. // Switch from video player scene to gallery scene.