VR Android 앱이 응답하지 않음

잘 판찰

여기에 이미지 설명 입력

간단한 360 비디오 뷰어를 만들고 있지만 계속 충돌합니다.

다음은 사용자가 동영상보기를 클릭하면 360 동영상이 열리는 선택 페이지의 코드입니다.

 package com.example.jal.jp;
import android.content.Intent;
    import android.os.Bundle;
    import android.support.design.widget.FloatingActionButton;
    import android.support.design.widget.Snackbar;
    import android.support.v7.app.AppCompatActivity;
    import android.support.v7.widget.Toolbar;
    import android.view.View;
    import android.widget.Button;

    public class Choices extends AppCompatActivity {

        public Button first_button;
        //public Button second_button;

        public void init(){
            first_button = (Button)findViewById(R.id.video);
           // second_button = (Button)findViewById(R.id.video);
            first_button.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent view = new Intent(Choices.this,VR_Video.class);
                    startActivity(view);
                }
            });
           /** second_button.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Intent view2 = new Intent(Choices.this,VR_Video.class);
                    startActivity(view2);

                }
            });*/
        }

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_choices);
            init();

        }

    }

다음은 Video Viewer 파일의 코드입니다.

package com.example.jal.jp;

import android.os.AsyncTask;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.SeekBar;

import com.google.vr.sdk.widgets.video.VrVideoEventListener;
import com.google.vr.sdk.widgets.video.VrVideoView;

import java.io.IOException;

public abstract class VR_Video extends AppCompatActivity implements SeekBar.OnSeekBarChangeListener {

    private static final String STATE_PROGRESS = "state_progress";
    private static final String STATE_DURATION = "state_duration";
    private VrVideoView mVrVideoView;
    private SeekBar mSeekBar;
    private Button mVolumeButton;

    private boolean mIsPaused;
    private boolean mIsMuted;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_vr__video);

        initViews();

    }
    @Override
    protected void onSaveInstanceState(Bundle outState) {
        outState.putLong(STATE_PROGRESS, mVrVideoView.getCurrentPosition());
        outState.putLong(STATE_DURATION, mVrVideoView.getDuration());

        super.onSaveInstanceState(outState);
    }

    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);

        long progress = savedInstanceState.getLong(STATE_PROGRESS);

        mVrVideoView.seekTo(progress);
        mSeekBar.setMax((int) savedInstanceState.getLong(STATE_DURATION));
        mSeekBar.setProgress((int) progress);
    }
    public void onPlayPausePressed() {

    }

    public void onVolumeToggleClicked() {
        mIsMuted = !mIsMuted;
        mVrVideoView.setVolume(mIsMuted ? 0.0f : 1.0f);

    }


    @Override
    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
        if( fromUser ) {
            mVrVideoView.seekTo(progress);
        }
    }
    private void initViews() {
        mVrVideoView = (VrVideoView) findViewById(R.id.video_view);
        mSeekBar = (SeekBar) findViewById(R.id.seek_bar);
        mVolumeButton = (Button) findViewById(R.id.btn_volume);
        mVrVideoView.setEventListener(new ActivityEventListener());
        //try { VrVideoView.Options options = new VrVideoView.Options(); options.inputType = VrVideoView.Options.TYPE_MONO;
          //  mVrVideoView.loadVideoFromAsset("sea.mp4", options); } catch( IOException e ) { //Handle exception }
        mSeekBar.setOnSeekBarChangeListener(this);
        mVolumeButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                onVolumeToggleClicked();
            }
        });
    }


    class VideoLoaderTask extends AsyncTask<Void, Void, Boolean> {

        @Override
        protected Boolean doInBackground(Void... voids) {
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    try {
                        // VrVideoView.Options options = new VrVideoView.Options();
                        //options.inputType = VrVideoView.Options.TYPE_MONO;
                        VrVideoView.Options options = new VrVideoView.Options(); options.inputType = VrVideoView.Options.TYPE_MONO;
                        mVrVideoView.loadVideoFromAsset("sea.mp4", options);
                    } catch(IOException e) {
                        //Handle exception
                    }
                    //your code here


                }
            });


            return true;
        }

        }

    public void playPause() {
        if( mIsPaused ) {
            mVrVideoView.playVideo();
        } else {
            mVrVideoView.pauseVideo();
        }

        mIsPaused = !mIsPaused;

    }
    @Override
    protected void onPause() {
        super.onPause();
        mVrVideoView.pauseRendering();
        mIsPaused = true;
    }

    @Override
    protected void onResume() {
        super.onResume();
        mVrVideoView.resumeRendering();
        mIsPaused = false;
    }

    @Override
    protected void onDestroy() {
        mVrVideoView.shutdown();
        super.onDestroy();
    }
    private class ActivityEventListener extends VrVideoEventListener {
        @Override
        public void onLoadSuccess() {
            super.onLoadSuccess();
            mSeekBar.setMax((int) mVrVideoView.getDuration());
            mIsPaused = false;


        }

        @Override
        public void onLoadError(String errorMessage) {
            super.onLoadError(errorMessage);
        }

        @Override
        public void onClick() {
            super.onClick();
            playPause();
        }

        @Override
        public void onNewFrame() {
            super.onNewFrame();
            mSeekBar.setProgress((int) mVrVideoView.getCurrentPosition());

        }

        @Override
        public void onCompletion() {
            super.onCompletion();
            mVrVideoView.seekTo(0);

        }

    }
}

Content_choices에 대한 코드.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.example.jal.jp.Choices"
    tools:showIn="@layout/activity_choices">

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Play VR Video"
        android:id="@+id/video"
        android:layout_marginTop="102dp"
        android:layout_alignParentTop="true"
        android:layout_alignLeft="@+id/survey"
        android:layout_alignStart="@+id/survey"
        android:background="#403e97"
        android:layout_alignRight="@+id/survey"
        android:layout_alignEnd="@+id/survey"
        android:textColor="#be3e3e" />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Take the Survey"
        android:id="@+id/survey"
        android:layout_marginTop="105dp"
        android:layout_below="@+id/video"
        android:layout_centerHorizontal="true"
        android:allowUndo="true"
        android:background="#2845a6"
        android:textColor="#8f2626" />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="360 View"
        android:id="@+id/view"
        android:layout_marginTop="89dp"
        android:layout_below="@+id/survey"
        android:layout_alignLeft="@+id/video"
        android:layout_alignStart="@+id/video"
        android:background="#223e80"
        android:layout_alignRight="@+id/video"
        android:layout_alignEnd="@+id/video"
        android:textColor="#bf1b1b" />
</RelativeLayout>

activity_vr_video.xml에 대한 코드

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.google.vr.sdk.widgets.video.VrVideoView
        android:id="@+id/video_view"
        android:layout_width="match_parent"
        android:layout_height="250dp"/>

    <SeekBar
        android:id="@+id/seek_bar"
        android:layout_height="32dp"
        android:layout_width="match_parent"
        style="?android:attr/progressBarStyleHorizontal"/>

    <Button
        android:id="@+id/btn_volume"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Volume Toggle"/>

</LinearLayout>

충돌 로그 :

06-27 00:03:17.626 1529-1548/? I/ActivityManager: Displayed com.example.jal.jp/.Choices: +387ms
06-27 00:03:17.716 2776-2789/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0xae9f0230
06-27 00:03:18.259 1609-1609/? D/skia: --- SkImageDecoder::Factory returned null
06-27 00:03:22.295 1529-1541/? I/ActivityManager: START u0 {cmp=com.example.jal.jp/.VR_Video} from uid 10058 on display 0
06-27 00:03:22.349 2776-2776/? D/AndroidRuntime: Shutting down VM
06-27 00:03:22.350 2776-2776/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                 Process: com.example.jal.jp, PID: 2776
                                                 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.jal.jp/com.example.jal.jp.VR_Video}: java.lang.InstantiationException: java.lang.Class<com.example.jal.jp.VR_Video> cannot be instantiated
                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)
                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                     at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                     at android.os.Looper.loop(Looper.java:148)
                                                     at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                     at java.lang.reflect.Method.invoke(Native Method)
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                  Caused by: java.lang.InstantiationException: java.lang.Class<com.example.jal.jp.VR_Video> cannot be instantiated
                                                     at java.lang.Class.newInstance(Native Method)
                                                     at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
                                                     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317)
                                                     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                                                     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                                                     at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                     at android.os.Looper.loop(Looper.java:148) 
                                                     at android.app.ActivityThread.main(ActivityThread.java:5417) 
                                                     at java.lang.reflect.Method.invoke(Native Method) 
                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
06-27 00:03:22.372 1529-1905/? W/ActivityManager:   Force finishing activity com.example.jal.jp/.VR_Video
06-27 00:03:22.384 1529-1905/? W/ActivityManager:   Force finishing activity com.example.jal.jp/.Choices
06-27 00:03:22.483 1529-2747/? I/OpenGLRenderer: Initialized EGL, version 1.4
06-27 00:03:22.772 1529-2747/? W/EGL_emulation: eglSurfaceAttrib not implemented
06-27 00:03:22.772 1529-2747/? W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x9b1d1ba0, error=EGL_SUCCESS
06-27 00:03:22.886 1529-1543/? W/ActivityManager: Activity pause timeout for ActivityRecord{a0649b u0 com.example.jal.jp/.VR_Video t26 f}
06-27 00:03:24.063 1609-1609/? D/skia: --- SkImageDecoder::Factory returned null
06-27 00:03:32.309 1529-1543/? W/ActivityManager: Launch timeout has expired, giving up wake lock!
06-27 00:03:32.390 1529-1543/? W/ActivityManager: Activity destroy timeout for ActivityRecord{3e989dd u0 com.example.jal.jp/.Choices t26 f}
06-27 00:03:42.336 1529-1543/? W/ActivityManager: Activity destroy timeout for ActivityRecord{a0649b u0 com.example.jal.jp/.VR_Video t26 f}
다만

귀하의 문제는 다음 줄에 있습니다.

Intent view = new Intent(Choices.this,VR_Video.class);

VR_Video 활동을 시작하려고했기 때문에 오류가 발생했지만 이것은 추상 클래스입니다. VR_Video 클래스에서 추상 키워드를 삭제하면 작동합니다.

그리고 인터페이스 메소드를 구현하십시오.

@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {

}

@Override
public void onStartTrackingTouch(SeekBar seekBar) {

}

@Override
public void onStopTrackingTouch(SeekBar seekBar) {

}

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

ANDROID : 데이터 삽입시 앱이 응답하지 않음

분류에서Dev

Openshift 앱이 응답하지 않음

분류에서Dev

티타늄 앱으로 인해 Android가 응답하지 않음

분류에서Dev

Android : Android 앱이 응답하지 않습니다. 닫으시겠습니까?

분류에서Dev

Kivy 앱 충돌 : "응답하지 않음"

분류에서Dev

스레드를 사용하여 응답하지 않는 Android 앱

분류에서Dev

Android 에뮬레이터 시작으로 인해 Mac이 응답하지 않음

분류에서Dev

Android DrawerLayout이 버튼 클릭 이벤트에 응답하지 않음

분류에서Dev

Unity에서 다시로드 할 때 Steam VR 장면이 응답하지 않습니다.

분류에서Dev

SQL Server LocalDB가있는 Winform 앱이 응답하지 않음

분류에서Dev

SQL Server LocalDB가있는 Winform 앱이 응답하지 않음

분류에서Dev

전환으로 인해 앱이 응답하지 않음

분류에서Dev

Rails 앱이 Postman 요청에 응답하지 않음

분류에서Dev

Python RegEx findall이 응답하지 않음

분류에서Dev

ctrl + shift + del이 응답하지 않음

분류에서Dev

UDP 소켓이 응답하지 않음

분류에서Dev

Ajax 요청이 응답하지 않음

분류에서Dev

Networkstream이 응답하지 않음

분류에서Dev

Facebook Messenger Bot이 응답하지 않음

분류에서Dev

Android-Google지도에 많은 선 그리기-응용 프로그램이 응답하지 않음

분류에서Dev

Android-앱이 시작되지 않음

분류에서Dev

내 버튼이 Android Studio에서 응답하지 않습니다.

분류에서Dev

데이터를 전송하는 동안 앱이 응답하지 않음

분류에서Dev

SQLite 데이터베이스 execSQL () 동안 앱이 응답하지 않음

분류에서Dev

Android Studio로 Gingerbread 빌드-화면이 터치 이벤트에 응답하지 않음

분류에서Dev

노드-Express-앱이 다른 서버에 응답하지 않음

분류에서Dev

Android Internet Explorer의 모바일에서 부트 스트랩 3 응답이 작동하지 않음

분류에서Dev

Xubuntu 16.04의 물리적 키보드에 Android 에뮬레이터가 응답하지 않음

분류에서Dev

Volley를 사용하여 Android Listview에서 JSON 응답이 제대로 인쇄되지 않음

Related 관련 기사

  1. 1

    ANDROID : 데이터 삽입시 앱이 응답하지 않음

  2. 2

    Openshift 앱이 응답하지 않음

  3. 3

    티타늄 앱으로 인해 Android가 응답하지 않음

  4. 4

    Android : Android 앱이 응답하지 않습니다. 닫으시겠습니까?

  5. 5

    Kivy 앱 충돌 : "응답하지 않음"

  6. 6

    스레드를 사용하여 응답하지 않는 Android 앱

  7. 7

    Android 에뮬레이터 시작으로 인해 Mac이 응답하지 않음

  8. 8

    Android DrawerLayout이 버튼 클릭 이벤트에 응답하지 않음

  9. 9

    Unity에서 다시로드 할 때 Steam VR 장면이 응답하지 않습니다.

  10. 10

    SQL Server LocalDB가있는 Winform 앱이 응답하지 않음

  11. 11

    SQL Server LocalDB가있는 Winform 앱이 응답하지 않음

  12. 12

    전환으로 인해 앱이 응답하지 않음

  13. 13

    Rails 앱이 Postman 요청에 응답하지 않음

  14. 14

    Python RegEx findall이 응답하지 않음

  15. 15

    ctrl + shift + del이 응답하지 않음

  16. 16

    UDP 소켓이 응답하지 않음

  17. 17

    Ajax 요청이 응답하지 않음

  18. 18

    Networkstream이 응답하지 않음

  19. 19

    Facebook Messenger Bot이 응답하지 않음

  20. 20

    Android-Google지도에 많은 선 그리기-응용 프로그램이 응답하지 않음

  21. 21

    Android-앱이 시작되지 않음

  22. 22

    내 버튼이 Android Studio에서 응답하지 않습니다.

  23. 23

    데이터를 전송하는 동안 앱이 응답하지 않음

  24. 24

    SQLite 데이터베이스 execSQL () 동안 앱이 응답하지 않음

  25. 25

    Android Studio로 Gingerbread 빌드-화면이 터치 이벤트에 응답하지 않음

  26. 26

    노드-Express-앱이 다른 서버에 응답하지 않음

  27. 27

    Android Internet Explorer의 모바일에서 부트 스트랩 3 응답이 작동하지 않음

  28. 28

    Xubuntu 16.04의 물리적 키보드에 Android 에뮬레이터가 응답하지 않음

  29. 29

    Volley를 사용하여 Android Listview에서 JSON 응답이 제대로 인쇄되지 않음

뜨겁다태그

보관