Skip to content

CommenPlayer ——Video player, Support ijkPlayer, Vlc, MediaPlayer, ExoPlayer; 视频播放器,支持ijkPlayer,Vlc,MediaPlayer,ExoPlayer

Notifications You must be signed in to change notification settings

Dsiner/CommenPlayer

Repository files navigation

CommenPlayer for Android

License API Readme

CommenPlayer

Video player for the Android platform based on ijkplayer, Android MediaPlayer, ExoPlayer / Vlc

Branch

  • master - Develop branch,dependencies,less codec/format for smaller binary size,base on ijkplayer ,support ijkplayer、Android MediaPlayer、ExoPlayer
  • ijkplayer-lite-0.7.6 with .so file - Release branch,with .so file,less codec/format for smaller binary size,base on ijkplayer ,support ijkplayer、Android MediaPlayer、ExoPlayer
  • ijkplayer-lite-0.8.8 with .so file - Release branch,with .so file,less codec/format for smaller binary size,base on ijkplayer ,support ijkplayer、Android MediaPlayer、ExoPlayer
  • ijkplayer-default-0.7.6 with .so file - Release branch,with .so file,more codec/format,base on ijkplayer ,support ijkplayer、Android MediaPlayer、ExoPlayer
  • ijkplayer-default-0.8.8 with .so file - Release branch,with .so file,more codec/format,base on ijkplayer ,support ijkplayer、Android MediaPlayer、ExoPlayer
  • Vlc - Beta branch,base on Vlc

Demo

Screenshot

Features

  • Supports local and network video playback
  • Live streaming support for M3U8, RTMP, RTSP, UDP protocols
  • Supports common audio and video file playback (MP4, mp3, flv, etc.)
  • Support playback control, progress display
  • Support gestures to adjust playback progress, brightness, sound
  • Supports screen size switching (16:9, 4:3, adaptive, full, etc.)
  • Supports horizontal and vertical screen switching, full screen mode, list playback, list playback/full screen mode switching
  • Supports full screen immersive mode

Usage

    <com.d.lib.commenplayer.CommenPlayer
        android:id="@+id/player"
        android:layout_width="match_parent"
        android:layout_height="180dp" />

Operation

        player.setLive(false);
        player.setOnNetListener(new OnNetListener() {
            @Override
            public void onIgnoreMobileNet() {
                ignoreNet = true;
            }
        }).setOnPlayerListener(new IPlayerListener() {
            @Override
            public void onLoading() {
                player.getControl().setState(ControlLayout.STATE_LOADING);
            }

            @Override
            public void onCompletion(IMediaPlayer mp) {
                player.getControl().setState(ControlLayout.STATE_COMPLETION);
            }

            @Override
            public void onPrepared(IMediaPlayer mp) {
                if (!ignoreNet && NetConstans.NET_STATUS == NetConstans.CONNECTED_MOBILE) {
                    player.pause();
                    player.getControl().setState(ControlLayout.STATE_MOBILE_NET);
                } else {
                    player.getControl().setState(ControlLayout.STATE_PREPARED);
                }
            }

            @Override
            public boolean onError(IMediaPlayer mp, int what, int extra) {
                player.getControl().setState(ControlLayout.STATE_ERROR);
                return false;
            }

            @Override
            public boolean onInfo(IMediaPlayer mp, int what, int extra) {
                return false;
            }

            @Override
            public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sarNum, int sarDen) {

            }
        });
        player.play(url);

Activity Lifecycle

    Override onResume()、onPause()、onConfigurationChanged()、onBackPressed()、onDestroy()

More usage see Demo

Latest Changes

Contributors

Thanks

Licence

Copyright 2017 D

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.

About

CommenPlayer ——Video player, Support ijkPlayer, Vlc, MediaPlayer, ExoPlayer; 视频播放器,支持ijkPlayer,Vlc,MediaPlayer,ExoPlayer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages