remove FullscreenVideoViewer
1
libs/fullscreenvideoview/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
/build
|
|
@ -1,27 +0,0 @@
|
|||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
compileSdkVersion 28
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 28
|
||||
versionCode 11
|
||||
versionName "1.1.3"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
}
|
||||
|
||||
//apply from: '../maven_push.gradle'
|
|
@ -1,3 +0,0 @@
|
|||
POM_NAME=FullscreenVideoView Library
|
||||
POM_ARTIFACT_ID=fullscreenvideoview
|
||||
POM_PACKAGING=aar
|
17
libs/fullscreenvideoview/proguard-rules.pro
vendored
|
@ -1,17 +0,0 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in /Applications/ADT/sdk/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the proguardFiles
|
||||
# directive in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
|
@ -1,4 +0,0 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.github.rtoshiro.view.video">
|
||||
|
||||
</manifest>
|
|
@ -1,336 +0,0 @@
|
|||
/**
|
||||
* Copyright (C) 2016 Toshiro Sugii
|
||||
* <p/>
|
||||
* 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
|
||||
* <p/>
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p/>
|
||||
* 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.
|
||||
*/
|
||||
package com.github.rtoshiro.view.video;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.media.MediaPlayer;
|
||||
import android.os.Handler;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class FullscreenVideoLayout extends FullscreenVideoView implements View.OnClickListener, SeekBar.OnSeekBarChangeListener, MediaPlayer.OnPreparedListener {
|
||||
|
||||
/**
|
||||
* Log cat TAG name
|
||||
*/
|
||||
private final static String TAG = "FullscreenVideoLayout";
|
||||
|
||||
/**
|
||||
* RelativeLayout that contains all control related views
|
||||
*/
|
||||
public View videoControlsView;
|
||||
|
||||
/**
|
||||
* SeekBar reference (from videoControlsView)
|
||||
*/
|
||||
protected SeekBar seekBar;
|
||||
|
||||
/**
|
||||
* Reference to ImageButton play
|
||||
*/
|
||||
protected ImageButton imgplay;
|
||||
|
||||
/**
|
||||
* Reference to ImageButton fullscreen
|
||||
*/
|
||||
protected ImageButton imgfullscreen;
|
||||
|
||||
/**
|
||||
* Reference to TextView for elapsed time and total time
|
||||
*/
|
||||
protected TextView textTotal, textElapsed;
|
||||
|
||||
/**
|
||||
* Handler and Runnable to keep tracking on elapsed time
|
||||
*/
|
||||
protected static final Handler TIME_THREAD = new Handler();
|
||||
protected Runnable updateTimeRunnable = new Runnable() {
|
||||
public void run() {
|
||||
updateCounter();
|
||||
|
||||
TIME_THREAD.postDelayed(this, 200);
|
||||
}
|
||||
};
|
||||
|
||||
public FullscreenVideoLayout(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public FullscreenVideoLayout(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public FullscreenVideoLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void release() {
|
||||
super.release();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initObjects() {
|
||||
super.initObjects();
|
||||
|
||||
if (this.videoControlsView == null) {
|
||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
this.videoControlsView = inflater.inflate(R.layout.view_videocontrols, this, false);
|
||||
}
|
||||
|
||||
if (videoControlsView != null) {
|
||||
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
params.addRule(ALIGN_PARENT_BOTTOM);
|
||||
addView(videoControlsView, params);
|
||||
|
||||
this.seekBar = this.videoControlsView.findViewById(R.id.vcv_seekbar);
|
||||
this.imgfullscreen = this.videoControlsView.findViewById(R.id.vcv_img_fullscreen);
|
||||
this.imgplay = this.videoControlsView.findViewById(R.id.vcv_img_play);
|
||||
this.textTotal = this.videoControlsView.findViewById(R.id.vcv_txt_total);
|
||||
this.textElapsed = this.videoControlsView.findViewById(R.id.vcv_txt_elapsed);
|
||||
}
|
||||
|
||||
if (this.imgplay != null)
|
||||
this.imgplay.setOnClickListener(this);
|
||||
if (this.imgfullscreen != null)
|
||||
this.imgfullscreen.setOnClickListener(this);
|
||||
if (this.seekBar != null)
|
||||
this.seekBar.setOnSeekBarChangeListener(this);
|
||||
|
||||
// Start controls invisible. Make it visible when it is prepared
|
||||
if (this.videoControlsView != null)
|
||||
this.videoControlsView.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void releaseObjects() {
|
||||
super.releaseObjects();
|
||||
|
||||
if (this.videoControlsView != null)
|
||||
removeView(this.videoControlsView);
|
||||
}
|
||||
|
||||
protected void startCounter() {
|
||||
Log.d(TAG, "startCounter");
|
||||
|
||||
TIME_THREAD.postDelayed(updateTimeRunnable, 200);
|
||||
}
|
||||
|
||||
protected void stopCounter() {
|
||||
Log.d(TAG, "stopCounter");
|
||||
|
||||
TIME_THREAD.removeCallbacks(updateTimeRunnable);
|
||||
}
|
||||
|
||||
protected void updateCounter() {
|
||||
if (this.textElapsed == null)
|
||||
return;
|
||||
|
||||
int elapsed = getCurrentPosition();
|
||||
// getCurrentPosition is a little bit buggy :(
|
||||
if (elapsed > 0 && elapsed < getDuration()) {
|
||||
seekBar.setProgress(elapsed);
|
||||
|
||||
elapsed = Math.round(elapsed / 1000.f);
|
||||
long s = elapsed % 60;
|
||||
long m = (elapsed / 60) % 60;
|
||||
long h = (elapsed / (60 * 60)) % 24;
|
||||
|
||||
if (h > 0)
|
||||
textElapsed.setText(String.format(Locale.US, "%d:%02d:%02d", h, m, s));
|
||||
else
|
||||
textElapsed.setText(String.format(Locale.US, "%02d:%02d", m, s));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompletion(MediaPlayer mp) {
|
||||
Log.d(TAG, "onCompletion");
|
||||
|
||||
super.onCompletion(mp);
|
||||
stopCounter();
|
||||
updateControls();
|
||||
if (currentState != State.ERROR)
|
||||
updateCounter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onError(MediaPlayer mp, int what, int extra) {
|
||||
boolean result = super.onError(mp, what, extra);
|
||||
stopCounter();
|
||||
updateControls();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
if (getCurrentState() == State.END) {
|
||||
Log.d(TAG, "onDetachedFromWindow END");
|
||||
stopCounter();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tryToPrepare() {
|
||||
Log.d(TAG, "tryToPrepare");
|
||||
super.tryToPrepare();
|
||||
|
||||
if (getCurrentState() == State.PREPARED || getCurrentState() == State.STARTED) {
|
||||
if (textElapsed != null && textTotal != null) {
|
||||
int total = getDuration();
|
||||
if (total > 0) {
|
||||
seekBar.setMax(total);
|
||||
seekBar.setProgress(0);
|
||||
|
||||
total = total / 1000;
|
||||
long s = total % 60;
|
||||
long m = (total / 60) % 60;
|
||||
long h = (total / (60 * 60)) % 24;
|
||||
if (h > 0) {
|
||||
textElapsed.setText("00:00:00");
|
||||
textTotal.setText(String.format(Locale.US, "%d:%02d:%02d", h, m, s));
|
||||
} else {
|
||||
textElapsed.setText("00:00");
|
||||
textTotal.setText(String.format(Locale.US, "%02d:%02d", m, s));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (videoControlsView != null)
|
||||
videoControlsView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() throws IllegalStateException {
|
||||
Log.d(TAG, "start");
|
||||
|
||||
if (!isPlaying()) {
|
||||
super.start();
|
||||
startCounter();
|
||||
updateControls();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pause() throws IllegalStateException {
|
||||
Log.d(TAG, "pause");
|
||||
|
||||
if (isPlaying()) {
|
||||
stopCounter();
|
||||
super.pause();
|
||||
updateControls();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
Log.d(TAG, "reset");
|
||||
|
||||
super.reset();
|
||||
|
||||
stopCounter();
|
||||
updateControls();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() throws IllegalStateException {
|
||||
Log.d(TAG, "stop");
|
||||
|
||||
super.stop();
|
||||
stopCounter();
|
||||
updateControls();
|
||||
}
|
||||
|
||||
protected void updateControls() {
|
||||
if (imgplay == null) return;
|
||||
|
||||
Drawable icon;
|
||||
if (getCurrentState() == State.STARTED) {
|
||||
icon = context.getResources().getDrawable(R.drawable.fvl_selector_pause);
|
||||
} else {
|
||||
icon = context.getResources().getDrawable(R.drawable.fvl_selector_play);
|
||||
}
|
||||
imgplay.setBackgroundDrawable(icon);
|
||||
}
|
||||
|
||||
public void hideControls() {
|
||||
Log.d(TAG, "hideControls");
|
||||
if (videoControlsView != null) {
|
||||
videoControlsView.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
public void showControls() {
|
||||
Log.d(TAG, "showControls");
|
||||
if (videoControlsView != null) {
|
||||
videoControlsView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Onclick action
|
||||
* Controls play button and fullscreen button.
|
||||
*
|
||||
* @param v View defined in XML
|
||||
*/
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.getId() == R.id.vcv_img_play) {
|
||||
if (isPlaying()) {
|
||||
pause();
|
||||
} else {
|
||||
start();
|
||||
}
|
||||
} else {
|
||||
setFullscreen(!isFullscreen());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SeekBar Listener
|
||||
*/
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
Log.d(TAG, "onProgressChanged " + progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
stopCounter();
|
||||
Log.d(TAG, "onStartTrackingTouch");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
int progress = seekBar.getProgress();
|
||||
seekTo(progress);
|
||||
Log.d(TAG, "onStopTrackingTouch");
|
||||
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 153 B |
Before Width: | Height: | Size: 154 B |
Before Width: | Height: | Size: 1.1 KiB |
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2010 The Android Open Source Project
|
||||
|
||||
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.
|
||||
-->
|
||||
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@android:id/background" android:drawable="@drawable/fvl_track" />
|
||||
<item android:id="@android:id/secondaryProgress">
|
||||
<scale android:scaleWidth="100%"
|
||||
android:drawable="@drawable/fvl_secondary" />
|
||||
</item>
|
||||
<item android:id="@android:id/progress">
|
||||
<scale android:scaleWidth="100%"
|
||||
android:drawable="@drawable/fvl_primary" />
|
||||
</item>
|
||||
</layer-list>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/fvl_fullscreen_reader" android:state_pressed="false" />
|
||||
<item android:drawable="@drawable/fvl_fullscreen_reader_white" android:state_pressed="true" />
|
||||
</selector>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/fvl_pause_reader" android:state_pressed="false" />
|
||||
<item android:drawable="@drawable/fvl_pause_reader_white" android:state_pressed="true" />
|
||||
</selector>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/fvl_play_reader" android:state_pressed="false" />
|
||||
<item android:drawable="@drawable/fvl_play_reader_white" android:state_pressed="true" />
|
||||
</selector>
|
|
@ -1,82 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
android:id="@+id/rel_videocontrols"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="0dp"
|
||||
android:background="#80cccccc">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/vcv_img_play"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_marginRight="0dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:background="@drawable/fvl_selector_play" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/vcv_txt_elapsed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toRightOf="@+id/vcv_img_play"
|
||||
android:text="00:00"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/vcv_img_fullscreen"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:layout_marginRight="0dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:background="@drawable/fvl_selector_fullscreen" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/vcv_txt_total"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_toLeftOf="@+id/vcv_img_fullscreen"
|
||||
android:text="00:00"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/vcv_seekbar"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="2dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_toLeftOf="@+id/vcv_txt_total"
|
||||
android:layout_toRightOf="@+id/vcv_txt_elapsed"
|
||||
android:indeterminateDrawable="@drawable/fvl_progress"
|
||||
android:maxHeight="13dp"
|
||||
android:minHeight="13dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:progressDrawable="@drawable/fvl_progress"
|
||||
android:thumb="@drawable/fvl_control_normal"
|
||||
android:thumbOffset="16dp" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
|
@ -1,6 +0,0 @@
|
|||
<resources>
|
||||
<string name="app_name">VideoLayout</string>
|
||||
|
||||
<string name="hello_world">Hello world!</string>
|
||||
<string name="action_settings">Settings</string>
|
||||
</resources>
|
|
@ -1,4 +1,3 @@
|
|||
include ':libs:android-transcoder'
|
||||
include ':libs:xmpp-addr'
|
||||
include ':libs:fullscreenvideoview'
|
||||
rootProject.name = 'PixArtMessenger'
|
||||
|
|