资源简介
vlc-android官方demo,播放本地视频,android studio 工程。播放rtsp网络视频流。 从官方from:https://code.videolan.org/videolan/libvlc-android-samples/tree/master/
改动而来,官方demo下载过来不能直接使用。
代码片段和文件信息
/*****************************************************************************
* JavaActivity.java
*****************************************************************************
* Copyright (C) 2016 VideoLAN
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD license. See the LICENSE file for details.
*****************************************************************************/
package org.videolan.javasample;
import android.annotation.TargetApi;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
import android.net.Uri;
import android.os.Build;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceView;
import android.view.TextureView;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.widget.frameLayout;
import org.videolan.libvlc.IVLCVout;
import org.videolan.libvlc.LibVLC;
import org.videolan.libvlc.Media;
import org.videolan.libvlc.MediaPlayer;
import java.io.IOException;
import java.util.ArrayList;
public class JavaActivity extends AppCompatActivity implements IVLCVout.OnNewVideoLayoutListener {
private static final boolean USE_SURFACE_VIEW = true;
private static final boolean ENABLE_SUBtitleS = true;
private static final String TAG = “JavaActivity“;
private static final String ASSET_FILENAME = “bbb.m4v“;
private static final int SURFACE_BEST_FIT = 0;
private static final int SURFACE_FIT_SCREEN = 1;
private static final int SURFACE_FILL = 2;
private static final int SURFACE_16_9 = 3;
private static final int SURFACE_4_3 = 4;
private static final int SURFACE_ORIGINAL = 5;
private static int CURRENT_SIZE = SURFACE_BEST_FIT;
private frameLayout mVideoSurfaceframe = null;
private SurfaceView mVideoSurface = null;
private SurfaceView mSubtitlesSurface = null;
private TextureView mVideoTexture = null;
private View mVideoView = null;
private final Handler mHandler = new Handler();
private View.OnLayoutChangeListener mOnLayoutChangeListener = null;
private LibVLC mLibVLC = null;
private MediaPlayer mMediaPlayer = null;
private int mVideoHeight = 0;
private int mVideoWidth = 0;
private int mVideoVisibleHeight = 0;
private int mVideoVisibleWidth = 0;
private int mVideoSarNum = 0;
private int mVideoSarDen = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final ArrayList args = new ArrayList<>();
args.add(“-vvv“);
mLibVLC = new LibVLC(this args);
mMediaPlayer = new MediaPlayer(mLibVLC);
mVideoSurfaceframe = (frameLayout) findViewById(R.id.video_surface_frame);
if (USE_SURFACE_VIEW) {
ViewStub stub = (ViewStub) findViewById(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-03-22 16:28 libvlc-android-samples-master\
文件 93 2018-10-25 17:20 libvlc-android-samples-master\.gitignore
目录 0 2019-03-22 16:25 libvlc-android-samples-master\.gradle\
目录 0 2019-03-22 16:28 libvlc-android-samples-master\.gradle\4.6\
目录 0 2019-03-22 16:24 libvlc-android-samples-master\.gradle\4.6\fileChanges\
文件 1 2019-03-22 16:50 libvlc-android-samples-master\.gradle\4.6\fileChanges\last-build.bin
目录 0 2019-03-22 16:25 libvlc-android-samples-master\.gradle\4.6\fileContent\
文件 17 2019-03-22 16:50 libvlc-android-samples-master\.gradle\4.6\fileContent\fileContent.lock
目录 0 2019-03-22 16:25 libvlc-android-samples-master\.gradle\4.6\fileHashes\
文件 774790 2019-03-22 16:41 libvlc-android-samples-master\.gradle\4.6\fileHashes\fileHashes.bin
文件 17 2019-03-22 16:50 libvlc-android-samples-master\.gradle\4.6\fileHashes\fileHashes.lock
文件 20809 2019-03-22 16:29 libvlc-android-samples-master\.gradle\4.6\fileHashes\resourceHashesCache.bin
目录 0 2019-03-22 16:28 libvlc-android-samples-master\.gradle\4.6\javaCompile\
文件 738880 2019-03-22 16:41 libvlc-android-samples-master\.gradle\4.6\javaCompile\classAnalysis.bin
文件 310935 2019-03-22 16:29 libvlc-android-samples-master\.gradle\4.6\javaCompile\jarAnalysis.bin
文件 17 2019-03-22 16:41 libvlc-android-samples-master\.gradle\4.6\javaCompile\javaCompile.lock
文件 299624 2019-03-22 16:41 libvlc-android-samples-master\.gradle\4.6\javaCompile\taskHistory.bin
文件 39225 2019-03-22 16:41 libvlc-android-samples-master\.gradle\4.6\javaCompile\taskJars.bin
目录 0 2019-03-22 16:25 libvlc-android-samples-master\.gradle\4.6\taskHistory\
文件 4633066 2019-03-22 16:41 libvlc-android-samples-master\.gradle\4.6\taskHistory\taskHistory.bin
文件 17 2019-03-22 16:50 libvlc-android-samples-master\.gradle\4.6\taskHistory\taskHistory.lock
目录 0 2019-03-22 16:25 libvlc-android-samples-master\.gradle\buildOutputCleanup\
文件 17 2019-03-22 16:50 libvlc-android-samples-master\.gradle\buildOutputCleanup\buildOutputCleanup.lock
文件 51 2019-03-22 16:25 libvlc-android-samples-master\.gradle\buildOutputCleanup\cache.properties
文件 26561 2019-03-22 16:41 libvlc-android-samples-master\.gradle\buildOutputCleanup\outputFiles.bin
目录 0 2019-03-22 16:24 libvlc-android-samples-master\.gradle\vcsWorkingDirs\
文件 0 2019-03-22 16:24 libvlc-android-samples-master\.gradle\vcsWorkingDirs\gc.properties
目录 0 2019-03-22 16:55 libvlc-android-samples-master\.idea\
目录 0 2019-03-22 16:24 libvlc-android-samples-master\.idea\codest
文件 1803 2019-03-22 16:24 libvlc-android-samples-master\.idea\codest
文件 745 2019-03-22 16:24 libvlc-android-samples-master\.idea\gradle.xm
............此处省略132个文件信息
- 上一篇:JSP旅游网站
- 下一篇:百度贴吧项目java+jsp+servlet+oracle
评论
共有 条评论