/*****************************************************************************
* VideoPlayerActivity.java
*****************************************************************************
* Copyright © 2011-2014 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
package org.videolan.vlc.gui.video;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.KeyguardManager;
import android.app.Presentation;
import android.bluetooth.BluetoothA2dp;
import android.bluetooth.BluetoothHeadset;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.media.AudioManager;
import android.media.MediaRouter;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.v4.app.FragmentManager;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.view.GestureDetectorCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.GestureDetector;
import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.Surface;
import android.view.SurfaceView;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLayoutChangeListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.AnimationUtils;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
import android.widget.Toast;
import org.videolan.libvlc.IVLCVout;
import org.videolan.libvlc.LibVLC;
import org.videolan.libvlc.Media;
import org.videolan.libvlc.MediaPlayer;
import org.videolan.libvlc.util.AndroidUtil;
import org.videolan.libvlc.util.HWDecoderUtil;
import org.videolan.vlc.BuildConfig;
import org.videolan.vlc.PlaybackService;
import org.videolan.vlc.R;
import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.gui.MainActivity;
import org.videolan.vlc.gui.PlaybackServiceActivity;
import org.videolan.vlc.gui.audio.PlaylistAdapter;
import org.videolan.vlc.gui.browser.FilePickerActivity;
import org.videolan.vlc.gui.dialogs.AdvOptionsDialog;
import org.videolan.vlc.gui.helpers.OnRepeatListener;
import org.videolan.vlc.gui.helpers.SwipeDragItemTouchHelperCallback;
import org.videolan.vlc.gui.helpers.UiTools;
import org.videolan.vlc.gui.preferences.PreferencesActivity;
import org.videolan.vlc.gui.tv.audioplayer.AudioPlayerActivity;
import org.videolan.vlc.interfaces.IPlaybackSettingsController;
import org.videolan.vlc.media.MediaDatabase;
import org.videolan.vlc.media.MediaUtils;
import org.videolan.vlc.media.MediaWrapper;
import org.videolan.vlc.util.AndroidDevices;
import org.videolan.vlc.util.FileUtils;
import org.videolan.vlc.util.Permissions;
import org.videolan.vlc.util.Strings;
import org.videolan.vlc.util.SubtitlesDownloader;
import org.videolan.vlc.util.Util;
import org.videolan.vlc.util.VLCInstance;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.StreamCorruptedException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.Callback,
GestureDetector.OnDoubleTapListener, IPlaybackSettingsController,
PlaybackService.Client.Callback, PlaybackService.Callback, PlaylistAdapter.IPlayer, OnClickListener, View.OnLongClickListener {
public final static String TAG = "VLC/VideoPlayerActivity";
// Internal intent identifier to distinguish between internal launch and
// external intent.
public final static String PLAY_FROM_VIDEOGRID = Strings.buildPkgString("gui.video.PLAY_FROM_VIDEOGRID");
public final static String PLAY_FROM_SERVICE = Strings.buildPkgString("gui.video.PLAY_FROM_SERVICE");
public final static String EXIT_PLAYER = Strings.buildPkgString("gui.video.EXIT_PLAYER");
public final static String PLAY_EXTRA_ITEM_LOCATION = "item_location";
public final static String PLAY_EXTRA_SUBTITLES_LOCATION = "subtitles_location";
public final static String PLAY_EXTRA_ITEM_TITLE = "title";
public final static String PLAY_EXTRA_FROM_START = "from_start";
public final static String PLAY_EXTRA_START_TIME = "position";
public final static String PLAY_EXTRA_OPENED_POSITION = "opened_position";
public final static String PLAY_DISABLE_HARDWARE = "disable_hardware";
public final static String ACTION_RESULT = Strings.buildPkgString("player.result");
public final static String EXTRA_POSITION = "extra_position";
public final static String EXTRA_DURATION = "extra_duration";
public final static int RESULT_CONNECTION_FAILED = RESULT_FIRST_USER + 1;
public final static int RESULT_PLAYBACK_ERROR = RESULT_FIRST_USER + 2;
public final static int RESULT_HARDWARE_ACCELERATION_ERROR = RESULT_FIRST_USER + 3;
public final static int RESULT_VIDEO_TRACK_LOST = RESULT_FIRST_USER + 4;
private final PlaybackServiceActivity.Helper mHelper = new PlaybackServiceActivity.Helper(this, this);
private PlaybackService mService;
private SurfaceView mSurfaceView = null;
private SurfaceView mSubtitlesSurfaceView = null;
private View mRootView;
private FrameLayout mSurfaceFrame;
private MediaRouter mMediaRouter;
private MediaRouter.SimpleCallback mMediaRouterCallback;
private SecondaryDisplay mPresentation;
private int mPresentationDisplayId = -1;
private Uri mUri;
private boolean mAskResume = true;
pr
Kinonoyomeo
- 粉丝: 92
- 资源: 1万+
最新资源
- 毕设和企业适用springboot企业数据管理平台类及智能城市数据管理平台源码+论文+视频.zip
- 毕设和企业适用springboot企业数据管理平台类及智能农业平台源码+论文+视频.zip
- 毕设和企业适用springboot企业数据监控平台类及机器人控制平台源码+论文+视频.zip
- 毕设和企业适用springboot企业数据监控平台类及风险控制平台源码+论文+视频.zip
- 毕设和企业适用springboot企业数据监控平台类及电影票务系统源码+论文+视频.zip
- 毕设和企业适用springboot企业数据监控平台类及教育信息平台源码+论文+视频.zip
- 毕设和企业适用springboot企业数据监控平台类及技术文档管理平台源码+论文+视频.zip
- 毕设和企业适用springboot企业数据监控平台类及健身管理平台源码+论文+视频.zip
- 毕设和企业适用springboot企业数据监控平台类及酒店管理平台源码+论文+视频.zip
- 毕设和企业适用springboot企业数据监控平台类及流媒体内容推荐平台源码+论文+视频.zip
- 毕设和企业适用springboot企业数据监控平台类及民生服务平台源码+论文+视频.zip
- 毕设和企业适用springboot企业数据监控平台类及企业电子化平台源码+论文+视频.zip
- 毕设和企业适用springboot企业数据监控平台类及企业供应链平台源码+论文+视频.zip
- 毕设和企业适用springboot企业数据监控平台类及农场管理系统源码+论文+视频.zip
- 毕设和企业适用springboot企业数据监控平台类及企业级API管理平台源码+论文+视频.zip
- 毕设和企业适用springboot企业数据监控平台类及全渠道电商平台源码+论文+视频.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈