Coder Social home page Coder Social logo

07101994 / md360player4android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ashqal/md360player4android

0.0 2.0 0.0 48.58 MB

It is a lite library to render 360 degree panorama video for Android. VR Player.

License: Apache License 2.0

Java 98.90% GLSL 1.10%

md360player4android's Introduction

MD360Player4Android

It is a lite library to render 360 degree panorama video for Android.

Preview

ScreenShot ScreenShot ScreenShot

NOTICE

  • OpenGLES 2.0 required
  • Android 4.0.3 (Ice Cream Sandwich API-15) required
  • Compatible with all Players which have setSurface api.
  • This library do nothing but render the image of video frame, so you may deal with the issues about MediaPlayer or IjkMediaPlayer (e.g. play local file, rtmp, hls) by yourself;
  • 这个库只负责视频帧画面的渲染,所有的视频文件播放、控制的工作都交给了MediaPlayer或者IjkMediaPlayer,你可能需要自己处理使用Player过程中出现的问题(比如播放本地文件、rtmp、hls).
  • Working with vlc

Gradle

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}
dependencies {
    compile 'com.github.ashqal:MD360Player4Android:2.1.0'
}

USAGE

Using with GLSurfaceView

STEP1 Define GLSurfaceView in the layout xml.

<android.opengl.GLSurfaceView
   android:id="@+id/surface_view"
   android:layout_width="match_parent"
   android:layout_height="match_parent" />

STEP2 Init the MDVRLibrary in the Activity.

public class MDVRLibraryDemoActivity extends MediaPlayerActivity {

    private MDVRLibrary mVRLibrary;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_md_render);

        // init VR Library
        initVRLibrary();
    }

    private void initVRLibrary(){
        // new instance
        mVRLibrary = MDVRLibrary.with(this)
                    .displayMode(MDVRLibrary.DISPLAY_MODE_NORMAL)
                    .interactiveMode(MDVRLibrary.INTERACTIVE_MODE_MOTION)
                    .asVideo(new MDVRLibrary.IOnSurfaceReadyCallback() {
                        @Override
                        public void onSurfaceReady(Surface surface) {
                            // IjkMediaPlayer or MediaPlayer
                            getPlayer().setSurface(surface);
                        }
                    })
                    .build(R.id.surface_view);
    }
}

STEP3 Addition call in onResume onPause onDestroy onConfigurationChanged.

public class MDVRLibraryDemoActivity extends MediaPlayerActivity {

    @Override
    protected void onResume() {
        super.onResume();
        mVRLibrary.onResume(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
        mVRLibrary.onPause(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mVRLibrary.onDestroy();
    }
    
    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        mVRLibrary.onOrientationChanged(this);
    }
}

CHANGELOG

https://github.com/ashqal/MD360Player4Android/wiki/Changelog

Advanced Usage

https://github.com/ashqal/MD360Player4Android/wiki/Advanced-Usage

Reference

iOS Version

MD360Player4iOS

Q&A常见问题

Q&A常见问题

Feedback

##LICENSE

Copyright 2016 Asha

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

md360player4android's People

Contributors

ashqal avatar b95505017 avatar jksfood avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.