Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
classpath 'com.android.tools.build:gradle:3.4.0'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -16,5 +18,6 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Sep 14 15:16:09 CST 2015
#Sun Apr 28 16:47:14 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
12 changes: 6 additions & 6 deletions universalvideoview/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
compileSdkVersion 28
buildToolsVersion "28.0.3"

defaultConfig {
minSdkVersion 9
targetSdkVersion 23
minSdkVersion 14
targetSdkVersion 28
versionCode 4
versionName "1.1.0"
}
Expand All @@ -19,8 +19,8 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
}

apply from: "bintrayUpload.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ private void initControllerView(View v) {
mProgress.setMax(1000);
}

mEndTime = (TextView) v.findViewById(R.id.duration);
mCurrentTime = (TextView) v.findViewById(R.id.has_played);
mTitle = (TextView) v.findViewById(R.id.title);
mEndTime = v.findViewById(R.id.duration);
mCurrentTime = v.findViewById(R.id.has_played);
mTitle = v.findViewById(R.id.title);
mFormatBuilder = new StringBuilder();
mFormatter = new Formatter(mFormatBuilder, Locale.getDefault());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package com.universalvideoview;

import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
Expand All @@ -26,8 +25,6 @@
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Build;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
Expand Down Expand Up @@ -185,9 +182,8 @@ private void onMeasureKeepAspectRatio(int widthMeasureSpec, int heightMeasureSpe
height = width * mVideoHeight / mVideoWidth;
}
}
} else {
// no size yet, just adopt the given spec sizes
}
} // else: no size yet, just adopt the given spec sizes

setMeasuredDimension(width, height);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="出错了!"
android:text="@string/uvv_loading_error"
android:textColor="@android:color/white"
android:textSize="13dp" />
</LinearLayout>
</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="加载中..."
android:text="@string/uvv_loading"
android:textColor="@android:color/white"
android:textSize="13dp" />
</LinearLayout>
</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
android:layout_width="50dp"
android:layout_height="fill_parent"
android:background="#00000000"
android:contentDescription="返回"
android:contentDescription="@string/uvv_return"
android:gravity="center"
android:scaleType="centerInside"
android:src="@drawable/uvv_back_btn"
Expand Down Expand Up @@ -152,4 +152,4 @@
</RelativeLayout>


</RelativeLayout>
</RelativeLayout>
5 changes: 5 additions & 0 deletions universalvideoview/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<resources>
<string name="uvv_loading">Cargando...</string>
<string name="uvv_return">Volver</string>
<string name="uvv_loading_error">¡Algo ha ido mal!</string>
</resources>
5 changes: 5 additions & 0 deletions universalvideoview/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<resources>
<string name="uvv_loading">Chargement...</string>
<string name="uvv_return">Retour</string>
<string name="uvv_loading_error">Quelque chose c\'est mal passé !</string>
</resources>
5 changes: 5 additions & 0 deletions universalvideoview/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<resources>
<string name="uvv_loading">加载中...</string>
<string name="uvv_return">返回</string>
<string name="uvv_loading_error">出错了!</string>
</resources>
8 changes: 6 additions & 2 deletions universalvideoview/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<resources>
<string name="app_name">UniversalVideoView Library</string>
<string name="app_name" translatable="false">UniversalVideoView Library</string>

<string name="action_settings">Settings</string>
<string name="action_settings" translatable="false">Settings</string>

<string name="uvv_loading">Loading...</string>
<string name="uvv_return">Return</string>
<string name="uvv_loading_error">Something goes wrong!</string>
</resources>
14 changes: 7 additions & 7 deletions universalvideoviewsample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
compileSdkVersion 28
buildToolsVersion "28.0.3"

defaultConfig {
applicationId "com.universalvideoviewsample"
minSdkVersion 9
targetSdkVersion 23
minSdkVersion 14
targetSdkVersion 28
versionCode 3
versionName "1.0.2"
}
Expand All @@ -20,7 +20,7 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile project(':universalvideoview')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation project(':universalvideoview')
}
2 changes: 1 addition & 1 deletion universalvideoviewsample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:configChanges="orientation|keyboardHidden|screenSize">
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public class MainActivity extends AppCompatActivity implements UniversalVideoVie

private static final String TAG = "MainActivity";
private static final String SEEK_POSITION_KEY = "SEEK_POSITION_KEY";
private static final String VIDEO_URL = "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4";
// Use https video on devices/emulators over Android 7.0
// For Android 8 and over, you need to modify the manifest to handle http communication
private static final String VIDEO_URL = "https://www.quirksmode.org/html5/videos/big_buck_bunny.webm";

UniversalVideoView mVideoView;
UniversalMediaController mMediaController;
Expand All @@ -52,12 +54,12 @@ protected void onCreate(Bundle savedInstanceState) {

mVideoLayout = findViewById(R.id.video_layout);
mBottomLayout = findViewById(R.id.bottom_layout);
mVideoView = (UniversalVideoView) findViewById(R.id.videoView);
mMediaController = (UniversalMediaController) findViewById(R.id.media_controller);
mVideoView = findViewById(R.id.videoView);
mMediaController = findViewById(R.id.media_controller);
mVideoView.setMediaController(mMediaController);
setVideoAreaSize();
mVideoView.setVideoViewCallback(this);
mStart = (TextView) findViewById(R.id.start);
mStart = findViewById(R.id.start);

mStart.setOnClickListener(new View.OnClickListener() {
@Override
Expand Down