app/src/main/java/fi/finwe/orion360/sdk/pro/examples/minimal/MinimalVideoFilePlayer.java
public void playVideo(String path) {

        // Keep a reference to the current video path.
        mVideoPath = path;

        // When accessing paths on the external media, we should first check if it is currently
        // mounted or not (though, it is often built-in non-removable memory nowadays).
        if (path.equalsIgnoreCase(PRIVATE_EXTERNAL_VIDEO_PATH)
                || path.equalsIgnoreCase(PUBLIC_EXTERNAL_VIDEO_PATH)
                || path.equalsIgnoreCase(PRIVATE_EXPANSION_VIDEO_PATH)) {

            if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
                Toast.makeText(this, R.string.player_media_not_mounted,
                        Toast.LENGTH_LONG).show();
                return;
            }

        }

        // In case we want to access videos in public external folder on Android 6.0 or above,
        // we must ensure that READ_EXTERNAL_STORAGE permission is granted *before* attempting
        // to play the files in that location.
        if (path.equalsIgnoreCase(PUBLIC_EXTERNAL_VIDEO_PATH)) {

            if (Build.VERSION.SDK_INT >= 23 && ContextCompat.checkSelfPermission(this, Manifest
                    .permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {

                // Read permission has not been granted. As user can give the permission when
                // requested, the operation now becomes asynchronous: we must wait for
                // user's decision, and act when we receive a callback.
                ActivityCompat.requestPermissions(this, new String [] {
                        Manifest.permission.READ_EXTERNAL_STORAGE }, REQUEST_READ_STORAGE);
                return;

            }

        }

        // We can now play the video file.
        setContentUri(mVideoPath);
    }
/**
     * Play the given video file.
     *
     * @param path The full path to a video file to be played.
     */
Play the given video file.
@param path The full path to a video file to be played.
Play the given video file . @param path The full path to a video file to be played .
public void playVideo(String path) {
        mVideoPath = path;
        if (path.equalsIgnoreCase(PRIVATE_EXTERNAL_VIDEO_PATH)
                || path.equalsIgnoreCase(PUBLIC_EXTERNAL_VIDEO_PATH)
                || path.equalsIgnoreCase(PRIVATE_EXPANSION_VIDEO_PATH)) {
            if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
                Toast.makeText(this, R.string.player_media_not_mounted,
                        Toast.LENGTH_LONG).show();
                return;
            }
        }
        if (path.equalsIgnoreCase(PUBLIC_EXTERNAL_VIDEO_PATH)) {
            if (Build.VERSION.SDK_INT >= 23 && ContextCompat.checkSelfPermission(this, Manifest
                    .permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
                ActivityCompat.requestPermissions(this, new String [] {
                        Manifest.permission.READ_EXTERNAL_STORAGE }, REQUEST_READ_STORAGE);
                return;
            }
        }
        setContentUri(mVideoPath);
    }
public void playVideo ( String path ) { mVideoPath = path ; if ( path . equalsIgnoreCase ( PRIVATE_EXTERNAL_VIDEO_PATH ) || path . equalsIgnoreCase ( PUBLIC_EXTERNAL_VIDEO_PATH ) || path . equalsIgnoreCase ( PRIVATE_EXPANSION_VIDEO_PATH ) ) { if ( ! Environment . getExternalStorageState ( ) . equals ( Environment . MEDIA_MOUNTED ) ) { Toast . makeText ( this , R . string . player_media_not_mounted , Toast . LENGTH_LONG ) . show ( ) ; return ; } } if ( path . equalsIgnoreCase ( PUBLIC_EXTERNAL_VIDEO_PATH ) ) { if ( Build . VERSION . SDK_INT >= 23 && ContextCompat . checkSelfPermission ( this , Manifest . permission . READ_EXTERNAL_STORAGE ) != PackageManager . PERMISSION_GRANTED ) { ActivityCompat . requestPermissions ( this , new String [ ] { Manifest . permission . READ_EXTERNAL_STORAGE } , REQUEST_READ_STORAGE ) ; return ; } } setContentUri ( mVideoPath ) ; }
Play the given video file.
Play the given video file .
// Keep a reference to the current video path. // When accessing paths on the external media, we should first check if it is currently // mounted or not (though, it is often built-in non-removable memory nowadays). // In case we want to access videos in public external folder on Android 6.0 or above, // we must ensure that READ_EXTERNAL_STORAGE permission is granted *before* attempting // to play the files in that location. // Read permission has not been granted. As user can give the permission when // requested, the operation now becomes asynchronous: we must wait for // user's decision, and act when we receive a callback. // We can now play the video file.