コード例 #1
0
        /**
         * \brief Initialize a VideoMesh object.
         *
         * Intialize a VideMesh object, if necessary creates its own PikkartVideoPlayer.
         * @param am the app AssetManager.
         * @param movieUrl the video to be played, URL or file path
         * @param keyframeUrl the video keyframe image to be displayed
         * @param seekPosition the starting position (in milliseconds)
         * @param autostart whatever the video should autostart on detection
         * @param pikkartVideoPlayer an external PikkartVideoPlayer to use. If null, an internal one will be created.
         * @return true on success.
         */
        public bool InitMesh(AssetManager am,
                             String movieUrl,
                             String keyframeUrl,
                             int seekPosition,
                             bool autostart,
                             PikkartVideoPlayer pikkartVideoPlayer)
        {
            _glLoaded = false;

            GenerateMesh();
            if (pikkartVideoPlayer == null)
            {
                mPikkartVideoPlayer = new PikkartVideoPlayer();
                mPikkartVideoPlayer.init();
                mPikkartVideoPlayer.setActivity(mParentActivity);
            }
            else
            {
                mPikkartVideoPlayer = pikkartVideoPlayer;
            }
            mMovieUrl = movieUrl;
            mKeyframeTextureByteBuffer = RenderUtils.loadTexture(am, keyframeUrl, mKeyframeTextureDims);
            keyframeAspectRatio        = (float)mKeyframeTextureDims[1] / (float)mKeyframeTextureDims[0];

            mSeekPosition = seekPosition;
            mAutostart    = autostart;

            mTexCoordTransformationMatrix = new float[16];


            mIconBusyTextureByteBuffer  = RenderUtils.loadTexture(am, "media/busy.png", mIconBusyTextureDims);
            mIconPlayTextureByteBuffer  = RenderUtils.loadTexture(am, "media/play.png", mIconPlayTextureDims);
            mIconErrorTextureByteBuffer = RenderUtils.loadTexture(am, "media/error.png", mIconErrorTextureDims);
            _meshLoaded = true;

            return(true);
        }
コード例 #2
0
 /**
  * \brief Set to use an external video player.
  *
  * Call this before InitMesh, only if you want to use an external PikkartVideoPlayer
  * @param pikkartVideoPlayer the external PikkartVideoPlayer object.
  */
 public void SetVideoPlayer(PikkartVideoPlayer pikkartVideoPlayer)
 {
     mPikkartVideoPlayer = pikkartVideoPlayer;
 }