Commit b4d7d9964b46ab27b67ddd05754afe6fdfecad04

Authored by Imanol-Mikel Barba Sabariego
1 parent 58c38b15

Added VitamioDemo

VitamioDemo/.gitignore 0 → 100644
  1 +# built application files
  2 +*.apk
  3 +*.ap_
  4 +
  5 +# files for the dex VM
  6 +*.dex
  7 +
  8 +# Java class files
  9 +*.class
  10 +
  11 +# generated files
  12 +bin/
  13 +gen/
  14 +obj/
  15 +
  16 +# Local configuration file (sdk path, etc)
  17 +local.properties
  18 +
  19 +# Eclipse project files
  20 +.classpath
  21 +.project
... ...
VitamioDemo/.settings/org.eclipse.jdt.core.prefs 0 → 100644
  1 +eclipse.preferences.version=1
  2 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
  3 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
  4 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
  5 +org.eclipse.jdt.core.compiler.compliance=1.6
  6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate
  7 +org.eclipse.jdt.core.compiler.debug.localVariable=generate
  8 +org.eclipse.jdt.core.compiler.debug.sourceFile=generate
  9 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
  10 +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
  11 +org.eclipse.jdt.core.compiler.source=1.6
... ...
VitamioDemo/AndroidManifest.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3 + package="io.vov.vitamio.demo"
  4 + android:versionCode="1"
  5 + android:versionName="0.0.1" >
  6 +
  7 + <uses-sdk
  8 + android:minSdkVersion="7"
  9 + android:targetSdkVersion="16" />
  10 +
  11 + <uses-permission android:name="android.permission.WAKE_LOCK" />
  12 + <uses-permission android:name="android.permission.INTERNET" />
  13 +
  14 + <application
  15 + android:icon="@drawable/ic_launcher"
  16 + android:label="@string/vitamio_demo_name" >
  17 + <activity
  18 + android:name=".VideoViewDemo"
  19 + android:configChanges="orientation|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
  20 + android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
  21 + <intent-filter>
  22 + <action android:name="android.intent.action.MAIN" />
  23 +
  24 + <category android:name="android.intent.category.LAUNCHER" />
  25 + </intent-filter>
  26 + </activity>
  27 + <activity
  28 + android:name="io.vov.vitamio.activity.InitActivity"
  29 + android:configChanges="orientation|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
  30 + android:launchMode="singleTop"
  31 + android:theme="@android:style/Theme.NoTitleBar"
  32 + android:windowSoftInputMode="stateAlwaysHidden" />
  33 + </application>
  34 +
  35 +</manifest>
0 36 \ No newline at end of file
... ...
VitamioDemo/README.md 0 → 100644
  1 +VitamioDemo
  2 +===========
  3 +
  4 +Demo of Vitamio for Android
0 5 \ No newline at end of file
... ...
VitamioDemo/build.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project name="VitamioDemo" default="help">
  3 +
  4 + <!-- The local.properties file is created and updated by the 'android' tool.
  5 + It contains the path to the SDK. It should *NOT* be checked into
  6 + Version Control Systems. -->
  7 + <property file="local.properties" />
  8 +
  9 + <!-- The ant.properties file can be created by you. It is only edited by the
  10 + 'android' tool to add properties to it.
  11 + This is the place to change some Ant specific build properties.
  12 + Here are some properties you may want to change/update:
  13 +
  14 + source.dir
  15 + The name of the source directory. Default is 'src'.
  16 + out.dir
  17 + The name of the output directory. Default is 'bin'.
  18 +
  19 + For other overridable properties, look at the beginning of the rules
  20 + files in the SDK, at tools/ant/build.xml
  21 +
  22 + Properties related to the SDK location or the project target should
  23 + be updated using the 'android' tool with the 'update' action.
  24 +
  25 + This file is an integral part of the build system for your
  26 + application and should be checked into Version Control Systems.
  27 +
  28 + -->
  29 + <property file="ant.properties" />
  30 +
  31 + <!-- if sdk.dir was not set from one of the property file, then
  32 + get it from the ANDROID_HOME env var.
  33 + This must be done before we load project.properties since
  34 + the proguard config can use sdk.dir -->
  35 + <property environment="env" />
  36 + <condition property="sdk.dir" value="${env.ANDROID_HOME}">
  37 + <isset property="env.ANDROID_HOME" />
  38 + </condition>
  39 +
  40 + <!-- The project.properties file is created and updated by the 'android'
  41 + tool, as well as ADT.
  42 +
  43 + This contains project specific properties such as project target, and library
  44 + dependencies. Lower level build properties are stored in ant.properties
  45 + (or in .classpath for Eclipse projects).
  46 +
  47 + This file is an integral part of the build system for your
  48 + application and should be checked into Version Control Systems. -->
  49 + <loadproperties srcFile="project.properties" />
  50 +
  51 + <!-- quick check on sdk.dir -->
  52 + <fail
  53 + message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
  54 + unless="sdk.dir"
  55 + />
  56 +
  57 + <!--
  58 + Import per project custom build rules if present at the root of the project.
  59 + This is the place to put custom intermediary targets such as:
  60 + -pre-build
  61 + -pre-compile
  62 + -post-compile (This is typically used for code obfuscation.
  63 + Compiled code location: ${out.classes.absolute.dir}
  64 + If this is not done in place, override ${out.dex.input.absolute.dir})
  65 + -post-package
  66 + -post-build
  67 + -pre-clean
  68 + -->
  69 + <import file="custom_rules.xml" optional="true" />
  70 +
  71 + <!-- Import the actual build file.
  72 +
  73 + To customize existing targets, there are two options:
  74 + - Customize only one target:
  75 + - copy/paste the target into this file, *before* the
  76 + <import> task.
  77 + - customize it to your needs.
  78 + - Customize the whole content of build.xml
  79 + - copy/paste the content of the rules files (minus the top node)
  80 + into this file, replacing the <import> task.
  81 + - customize to your needs.
  82 +
  83 + ***********************
  84 + ****** IMPORTANT ******
  85 + ***********************
  86 + In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
  87 + in order to avoid having your file be overridden by tools such as "android update project"
  88 + -->
  89 + <!-- version-tag: 1 -->
  90 + <import file="${sdk.dir}/tools/ant/build.xml" />
  91 +
  92 +</project>
... ...
VitamioDemo/ic_launcher-web.png 0 → 100644

14 KB

VitamioDemo/proguard-project.txt 0 → 100644
  1 +# To enable ProGuard in your project, edit project.properties
  2 +# to define the proguard.config property as described in that file.
  3 +#
  4 +# Add project specific ProGuard rules here.
  5 +# By default, the flags in this file are appended to flags specified
  6 +# in ${sdk.dir}/tools/proguard/proguard-android.txt
  7 +# You can edit the include path and order by changing the ProGuard
  8 +# include property in project.properties.
  9 +#
  10 +# For more details, see
  11 +# http://developer.android.com/guide/developing/tools/proguard.html
  12 +
  13 +# Add any project specific keep options here:
  14 +
  15 +# If your project uses WebView with JS, uncomment the following
  16 +# and specify the fully qualified class name to the JavaScript interface
  17 +# class:
  18 +#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  19 +# public *;
  20 +#}
... ...
VitamioDemo/project.properties 0 → 100644
  1 +# This file is automatically generated by Android Tools.
  2 +# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
  3 +#
  4 +# This file must be checked in Version Control Systems.
  5 +#
  6 +# To customize properties used by the Ant build system edit
  7 +# "ant.properties", and override values to adapt the script to your
  8 +# project structure.
  9 +#
  10 +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
  11 +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
  12 +
  13 +# Project target.
  14 +target=Google Inc.:Google APIs:16
  15 +android.library.reference.1=../VitamioBundle
... ...
VitamioDemo/res/drawable-hdpi/ic_launcher.png 0 → 100644

2.74 KB

VitamioDemo/res/drawable-xhdpi/ic_launcher.png 0 → 100644

3.29 KB

VitamioDemo/res/layout/videoview.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:orientation="vertical" >
  6 +
  7 + <io.vov.vitamio.widget.CenterLayout
  8 + android:layout_width="match_parent"
  9 + android:layout_height="match_parent"
  10 + android:orientation="vertical" >
  11 +
  12 + <io.vov.vitamio.widget.VideoView
  13 + android:id="@+id/surface_view"
  14 + android:layout_width="match_parent"
  15 + android:layout_height="match_parent"
  16 + android:layout_centerHorizontal="true"
  17 + android:layout_centerVertical="true" />
  18 + </io.vov.vitamio.widget.CenterLayout>
  19 +
  20 +</LinearLayout>
0 21 \ No newline at end of file
... ...
VitamioDemo/res/values/strings.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<resources>
  3 +
  4 + <string name="vitamio_demo_name">VitamioDemo</string>
  5 +
  6 +</resources>
0 7 \ No newline at end of file
... ...
VitamioDemo/src/io/vov/vitamio/demo/VideoViewDemo.java 0 → 100644
  1 +/*
  2 + * Copyright (C) 2012 YIXIA.COM
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License");
  5 + * you may not use this file except in compliance with the License.
  6 + * You may obtain a copy of the License at
  7 + *
  8 + * http://www.apache.org/licenses/LICENSE-2.0
  9 + *
  10 + * Unless required by applicable law or agreed to in writing, software
  11 + * distributed under the License is distributed on an "AS IS" BASIS,
  12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + * See the License for the specific language governing permissions and
  14 + * limitations under the License.
  15 + */
  16 +
  17 +package io.vov.vitamio.demo;
  18 +
  19 +import io.vov.vitamio.MediaPlayer;
  20 +import io.vov.vitamio.widget.MediaController;
  21 +import io.vov.vitamio.widget.VideoView;
  22 +import android.app.Activity;
  23 +import android.content.res.Configuration;
  24 +import android.os.Bundle;
  25 +
  26 +public class VideoViewDemo extends Activity {
  27 +
  28 + private String path = "http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8";
  29 + private VideoView mVideoView;
  30 +
  31 + @Override
  32 + public void onCreate(Bundle icicle) {
  33 + super.onCreate(icicle);
  34 + if (!io.vov.vitamio.LibsChecker.checkVitamioLibs(this))
  35 + return;
  36 +
  37 + setContentView(R.layout.videoview);
  38 + mVideoView = (VideoView) findViewById(R.id.surface_view);
  39 + mVideoView.setVideoPath(path);
  40 + mVideoView.setVideoQuality(MediaPlayer.VIDEOQUALITY_HIGH);
  41 + mVideoView.setMediaController(new MediaController(this));
  42 + }
  43 +
  44 + @Override
  45 + public void onConfigurationChanged(Configuration newConfig) {
  46 + if (mVideoView != null)
  47 + mVideoView.setVideoLayout(VideoView.VIDEO_LAYOUT_SCALE, 0);
  48 + super.onConfigurationChanged(newConfig);
  49 + }
  50 +}
... ...