From 7fc4ab60caab97dcaa7c931ff5495148642fa646 Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Tue, 11 Dec 2012 03:49:43 +0000 Subject: [PATCH] Reproductor y controles hechos --- AndroidManifest.xml | 8 +++----- VitamioBundle/bin/classes/io/vov/vitamio/R$drawable.class | Bin 1094 -> 0 bytes VitamioBundle/bin/classes/io/vov/vitamio/R$id.class | Bin 683 -> 0 bytes VitamioBundle/bin/classes/io/vov/vitamio/R$layout.class | Bin 442 -> 0 bytes VitamioBundle/bin/classes/io/vov/vitamio/R$raw.class | Bin 424 -> 0 bytes VitamioBundle/bin/classes/io/vov/vitamio/R$string.class | Bin 848 -> 0 bytes VitamioBundle/bin/classes/io/vov/vitamio/R$style.class | Bin 502 -> 0 bytes VitamioBundle/bin/classes/io/vov/vitamio/widget/MediaController$1.class | Bin 1211 -> 0 bytes VitamioBundle/bin/classes/io/vov/vitamio/widget/MediaController$2.class | Bin 831 -> 0 bytes VitamioBundle/bin/classes/io/vov/vitamio/widget/MediaController$3.class | Bin 2942 -> 0 bytes VitamioBundle/bin/classes/io/vov/vitamio/widget/MediaController.class | Bin 11632 -> 0 bytes VitamioBundle/bin/io.vov.vitamio.activity.initactivity.jar | Bin 36757 -> 0 bytes VitamioBundle/lint.xml | 3 +++ VitamioBundle/project.properties | 2 +- VitamioBundle/res/drawable-hdpi/mediacontroller_ff_left.png | Bin 0 -> 865 bytes VitamioBundle/res/drawable-hdpi/mediacontroller_ff_right.png | Bin 0 -> 860 bytes VitamioBundle/res/layout/mediacontroller.xml | 54 ++++++++++++++++++++++++++++++++++++++---------------- VitamioBundle/src/io/vov/vitamio/widget/MediaController.java | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- gen/com/upc/pbe/upcnews/R.java | 240 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------- res/layout/activity_video.xml | 29 +++++++++++++++++++---------- res/values/styles.xml | 1 + src/com/upc/pbe/upcnews/HLS.java | 56 ++++++++++++++++++++++++++++++++++++++------------------ src/com/upc/pbe/upcnews/MainActivity.java | 12 ++++++------ src/com/upc/pbe/upcnews/VideoActivity.java | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------------- 24 files changed, 352 insertions(+), 175 deletions(-) create mode 100644 VitamioBundle/lint.xml create mode 100644 VitamioBundle/res/drawable-hdpi/mediacontroller_ff_left.png create mode 100644 VitamioBundle/res/drawable-hdpi/mediacontroller_ff_right.png diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 283272a..a065888 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -10,8 +10,6 @@ - - - + - + - + + \ No newline at end of file diff --git a/VitamioBundle/project.properties b/VitamioBundle/project.properties index 36f1594..03d0617 100644 --- a/VitamioBundle/project.properties +++ b/VitamioBundle/project.properties @@ -11,5 +11,5 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-15 +target=android-10 android.library=true diff --git a/VitamioBundle/res/drawable-hdpi/mediacontroller_ff_left.png b/VitamioBundle/res/drawable-hdpi/mediacontroller_ff_left.png new file mode 100644 index 0000000..389f03f Binary files /dev/null and b/VitamioBundle/res/drawable-hdpi/mediacontroller_ff_left.png differ diff --git a/VitamioBundle/res/drawable-hdpi/mediacontroller_ff_right.png b/VitamioBundle/res/drawable-hdpi/mediacontroller_ff_right.png new file mode 100644 index 0000000..2473406 Binary files /dev/null and b/VitamioBundle/res/drawable-hdpi/mediacontroller_ff_right.png differ diff --git a/VitamioBundle/res/layout/mediacontroller.xml b/VitamioBundle/res/layout/mediacontroller.xml index 4a4afa0..4761eab 100644 --- a/VitamioBundle/res/layout/mediacontroller.xml +++ b/VitamioBundle/res/layout/mediacontroller.xml @@ -1,7 +1,7 @@ - - + android:layout_marginTop="2dip" > + + + + + + + \ No newline at end of file diff --git a/VitamioBundle/src/io/vov/vitamio/widget/MediaController.java b/VitamioBundle/src/io/vov/vitamio/widget/MediaController.java index 3d2e1f9..a695f03 100644 --- a/VitamioBundle/src/io/vov/vitamio/widget/MediaController.java +++ b/VitamioBundle/src/io/vov/vitamio/widget/MediaController.java @@ -89,6 +89,9 @@ public class MediaController extends FrameLayout { private static final int SHOW_PROGRESS = 2; private boolean mFromXml = false; private ImageButton mPauseButton; + private ImageButton mFFLeftButton; + private ImageButton mFFRightButton; + private AudioManager mAM; @@ -156,10 +159,21 @@ public class MediaController extends FrameLayout { private void initControllerView(View v) { mPauseButton = (ImageButton) v.findViewById(R.id.mediacontroller_play_pause); + mFFLeftButton = (ImageButton) v.findViewById(R.id.ImageButton01); + mFFRightButton = (ImageButton) v.findViewById(R.id.ImageButton02); if (mPauseButton != null) { mPauseButton.requestFocus(); mPauseButton.setOnClickListener(mPauseListener); } + if (mFFLeftButton != null) { + mFFLeftButton.requestFocus(); + mFFLeftButton.setOnClickListener(mFFLeftListener); + } + if (mFFRightButton != null) { + mFFRightButton.requestFocus(); + mFFRightButton.setOnClickListener(mFFRightListener); + } + mProgress = (ProgressBar) v.findViewById(R.id.mediacontroller_seekbar); if (mProgress != null) { @@ -196,6 +210,8 @@ public class MediaController extends FrameLayout { public void show() { show(sDefaultTimeout); } + + /** * Set the content of the file_name TextView @@ -258,6 +274,10 @@ public class MediaController extends FrameLayout { if (!mShowing && mAnchor != null && mAnchor.getWindowToken() != null) { if (mPauseButton != null) mPauseButton.requestFocus(); + if (mFFLeftButton != null) + mFFLeftButton.requestFocus(); + if (mFFRightButton != null) + mFFRightButton.requestFocus(); disableUnsupportedButtons(); if (mFromXml) { @@ -409,13 +429,40 @@ public class MediaController extends FrameLayout { return super.dispatchKeyEvent(event); } + public void setOnFFLeftListener(View.OnClickListener ocl) + { + mFFLeftListener = ocl; + if (mFFLeftButton != null) { + mFFLeftButton.requestFocus(); + mFFLeftButton.setOnClickListener(mFFLeftListener); + } + } + public void setOnFFRightListener(View.OnClickListener ocl) + { + mFFRightListener = ocl; + if (mFFRightButton != null) { + mFFRightButton.requestFocus(); + mFFRightButton.setOnClickListener(mFFRightListener); + } + } + private View.OnClickListener mPauseListener = new View.OnClickListener() { public void onClick(View v) { doPauseResume(); show(sDefaultTimeout); } }; + private View.OnClickListener mFFLeftListener = new View.OnClickListener() { + public void onClick(View v) { + } + }; + private View.OnClickListener mFFRightListener = new View.OnClickListener() { + public void onClick(View v) { + + } + }; + private void updatePausePlay() { if (mRoot == null || mPauseButton == null) return; @@ -480,8 +527,13 @@ public class MediaController extends FrameLayout { public void setEnabled(boolean enabled) { if (mPauseButton != null) mPauseButton.setEnabled(enabled); - if (mProgress != null) - mProgress.setEnabled(enabled); + if (mPauseButton != null) + mPauseButton.setEnabled(enabled); + if (mFFLeftButton != null) + mFFLeftButton.setEnabled(enabled); + if (mFFRightButton != null) + mFFRightButton.setEnabled(enabled); + disableUnsupportedButtons(); super.setEnabled(enabled); } diff --git a/gen/com/upc/pbe/upcnews/R.java b/gen/com/upc/pbe/upcnews/R.java index bf3549b..9bf560c 100644 --- a/gen/com/upc/pbe/upcnews/R.java +++ b/gen/com/upc/pbe/upcnews/R.java @@ -1,103 +1,137 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package com.upc.pbe.upcnews; - -public final class R { - public static final class array { - public static final int qualityNames=0x7f080000; - public static final int qualityValues=0x7f080001; - } - public static final class attr { - } - public static final class color { - public static final int Black=0x7f050002; - public static final int Blue=0x7f050004; - public static final int BlueAndroid=0x7f050005; - public static final int Gay=0x7f050007; - public static final int Gray=0x7f05000a; - public static final int Green=0x7f050009; - public static final int Orange=0x7f050003; - public static final int Red=0x7f050008; - public static final int White=0x7f050006; - public static final int Whyte_POwaH=0x7f050001; - public static final int backgroundmain=0x7f050000; - } - public static final class dimen { - public static final int TitleSize=0x7f060000; - public static final int lesize=0x7f060001; - } - public static final class drawable { - public static final int ic_action_search=0x7f020000; - public static final int ic_launcher=0x7f020001; - public static final int ic_ledarklogo=0x7f020002; - public static final int ic_menu_name=0x7f020003; - public static final int ic_startbutton=0x7f020004; - public static final int selectedonlist=0x7f020005; - public static final int selectedonlist2=0x7f020006; - public static final int startbuttontoggle=0x7f020007; - } - public static final class id { - public static final int LinearLayout1=0x7f0b0001; - public static final int RelativeLayout1=0x7f0b0006; - public static final int button=0x7f0b0007; - public static final int itemhelp=0x7f0b000d; - public static final int itemprefs=0x7f0b000c; - public static final int listView1=0x7f0b0003; - public static final int menu_settings=0x7f0b000b; - public static final int rowTextView=0x7f0b000a; - public static final int textView1=0x7f0b0004; - public static final int textView2=0x7f0b0005; - public static final int textViewTitle=0x7f0b0002; - public static final int textViewUrl=0x7f0b0009; - public static final int textViewXml=0x7f0b0008; - public static final int videoView1=0x7f0b0000; - } - public static final class layout { - public static final int activity_video=0x7f030000; - public static final int dirs=0x7f030001; - public static final int help=0x7f030002; - public static final int main_activity=0x7f030003; - public static final int rowlayout=0x7f030004; - } - public static final class menu { - public static final int activity_main=0x7f0a0000; - public static final int activity_video=0x7f0a0001; - public static final int menu=0x7f0a0002; - } - public static final class string { - public static final int app_name=0x7f070000; - public static final int button=0x7f07000c; - public static final int button1=0x7f07000d; - public static final int defaultQuality=0x7f070015; - public static final int defaultURL=0x7f070012; - public static final int desc=0x7f070009; - public static final int descarregar=0x7f070003; - public static final int dir=0x7f07000a; - public static final int directoris=0x7f07000b; - public static final int help=0x7f070008; - public static final int helpText=0x7f070011; - public static final int hint=0x7f070004; - public static final int menu_settings=0x7f070001; - public static final int prefs=0x7f070007; - public static final int qual=0x7f070013; - public static final int qual_hint=0x7f070014; - public static final int startbuttondescription=0x7f07000f; - public static final int title=0x7f07000e; - public static final int title_activity_main=0x7f070002; - public static final int title_activity_video=0x7f070010; - public static final int url=0x7f070005; - public static final int urlhint=0x7f070006; - } - public static final class style { - public static final int AppTheme=0x7f090000; - public static final int leBoldText=0x7f090001; - } - public static final class xml { - public static final int prefs=0x7f040000; - } -} +/* AUTO-GENERATED FILE. DO NOT MODIFY. + * + * This class was automatically generated by the + * aapt tool from the resource data it found. It + * should not be modified by hand. + */ + +package com.upc.pbe.upcnews; + +public final class R { + public static final class array { + public static final int qualityNames=0x7f0a0000; + public static final int qualityValues=0x7f0a0001; + } + public static final class attr { + } + public static final class color { + public static final int Black=0x7f080002; + public static final int Blue=0x7f080004; + public static final int BlueAndroid=0x7f080005; + public static final int Gay=0x7f080007; + public static final int Gray=0x7f08000a; + public static final int Green=0x7f080009; + public static final int Orange=0x7f080003; + public static final int Red=0x7f080008; + public static final int White=0x7f080006; + public static final int Whyte_POwaH=0x7f080001; + public static final int backgroundmain=0x7f080000; + } + public static final class dimen { + public static final int TitleSize=0x7f090000; + public static final int lesize=0x7f090001; + } + public static final class drawable { + public static final int ic_action_search=0x7f020000; + public static final int ic_launcher=0x7f020001; + public static final int ic_ledarklogo=0x7f020002; + public static final int ic_menu_name=0x7f020003; + public static final int ic_startbutton=0x7f020004; + public static final int mediacontroller_bg=0x7f020005; + public static final int mediacontroller_ff_left=0x7f020006; + public static final int mediacontroller_ff_right=0x7f020007; + public static final int mediacontroller_pause01=0x7f020008; + public static final int mediacontroller_pause02=0x7f020009; + public static final int mediacontroller_pause_button=0x7f02000a; + public static final int mediacontroller_play01=0x7f02000b; + public static final int mediacontroller_play02=0x7f02000c; + public static final int mediacontroller_play_button=0x7f02000d; + public static final int mediacontroller_seekbar=0x7f02000e; + public static final int mediacontroller_seekbar01=0x7f02000f; + public static final int mediacontroller_seekbar02=0x7f020010; + public static final int mediacontroller_seekbar_thumb=0x7f020011; + public static final int selectedonlist=0x7f020012; + public static final int selectedonlist2=0x7f020013; + public static final int startbuttontoggle=0x7f020014; + } + public static final class id { + public static final int ImageButton01=0x7f0c000f; + public static final int ImageButton02=0x7f0c0010; + public static final int LinearLayout1=0x7f0c0001; + public static final int RelativeLayout1=0x7f0c0006; + public static final int VideoView1=0x7f0c0000; + public static final int button=0x7f0c0007; + public static final int itemhelp=0x7f0c0014; + public static final int itemprefs=0x7f0c0013; + public static final int listView1=0x7f0c0003; + public static final int mediacontroller_file_name=0x7f0c000d; + public static final int mediacontroller_play_pause=0x7f0c000e; + public static final int mediacontroller_seekbar=0x7f0c000c; + public static final int mediacontroller_time_current=0x7f0c000a; + public static final int mediacontroller_time_total=0x7f0c000b; + public static final int menu_settings=0x7f0c0012; + public static final int rowTextView=0x7f0c0011; + public static final int textView1=0x7f0c0004; + public static final int textView2=0x7f0c0005; + public static final int textViewTitle=0x7f0c0002; + public static final int textViewUrl=0x7f0c0009; + public static final int textViewXml=0x7f0c0008; + } + public static final class layout { + public static final int activity_video=0x7f030000; + public static final int dirs=0x7f030001; + public static final int help=0x7f030002; + public static final int main_activity=0x7f030003; + public static final int mediacontroller=0x7f030004; + public static final int rowlayout=0x7f030005; + } + public static final class menu { + public static final int activity_main=0x7f0b0000; + public static final int activity_video=0x7f0b0001; + public static final int menu=0x7f0b0002; + } + public static final class raw { + public static final int libarm=0x7f050000; + } + public static final class string { + public static final int app_name=0x7f060007; + public static final int button=0x7f060013; + public static final int button1=0x7f060014; + public static final int defaultQuality=0x7f06001c; + public static final int defaultURL=0x7f060019; + public static final int desc=0x7f060010; + public static final int descarregar=0x7f06000a; + public static final int dir=0x7f060011; + public static final int directoris=0x7f060012; + public static final int help=0x7f06000f; + public static final int helpText=0x7f060018; + public static final int hint=0x7f06000b; + public static final int mediacontroller_play_pause=0x7f060006; + public static final int menu_settings=0x7f060008; + public static final int prefs=0x7f06000e; + public static final int qual=0x7f06001a; + public static final int qual_hint=0x7f06001b; + public static final int startbuttondescription=0x7f060016; + public static final int title=0x7f060015; + public static final int title_activity_main=0x7f060009; + public static final int title_activity_video=0x7f060017; + public static final int url=0x7f06000c; + public static final int urlhint=0x7f06000d; + public static final int vitamio_init_decoders=0x7f060001; + public static final int vitamio_name=0x7f060000; + public static final int vitamio_videoview_error_button=0x7f060005; + public static final int vitamio_videoview_error_text_invalid_progressive_playback=0x7f060003; + public static final int vitamio_videoview_error_text_unknown=0x7f060004; + public static final int vitamio_videoview_error_title=0x7f060002; + } + public static final class style { + public static final int AppTheme=0x7f070002; + public static final int FullScreen=0x7f070003; + public static final int MediaController_SeekBar=0x7f070000; + public static final int MediaController_Text=0x7f070001; + public static final int leBoldText=0x7f070004; + } + public static final class xml { + public static final int prefs=0x7f040000; + } +} diff --git a/res/layout/activity_video.xml b/res/layout/activity_video.xml index d604eb2..9d97094 100644 --- a/res/layout/activity_video.xml +++ b/res/layout/activity_video.xml @@ -1,13 +1,22 @@ - + + android:layout_height="match_parent" + android:background="@color/Black" + android:orientation="vertical" > - + - + + + + \ No newline at end of file diff --git a/res/values/styles.xml b/res/values/styles.xml index b0d6d1c..4616b25 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -1,6 +1,7 @@