Commit 2a6cf8396fc35cc4e819e38f3f6a19395460c6b2
1 parent
1aeaaa07
--no commit message
Showing
5 changed files
with
114 additions
and
110 deletions
.classpath
@@ -4,6 +4,6 @@ | @@ -4,6 +4,6 @@ | ||
4 | <classpathentry kind="src" path="gen"/> | 4 | <classpathentry kind="src" path="gen"/> |
5 | <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> | 5 | <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> |
6 | <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> | 6 | <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> |
7 | - <classpathentry kind="lib" path="C:/Users/Usuario/workspace/UPC NEWS/xuggle-xuggler.jar/xuggle-xuggler.jar"/> | 7 | + <classpathentry kind="lib" path="xuggle-xuggler.jar"/> |
8 | <classpathentry kind="output" path="bin/classes"/> | 8 | <classpathentry kind="output" path="bin/classes"/> |
9 | </classpath> | 9 | </classpath> |
gen/com/upc/pbe/upcnews/R.java
1 | -/* AUTO-GENERATED FILE. DO NOT MODIFY. | ||
2 | - * | ||
3 | - * This class was automatically generated by the | ||
4 | - * aapt tool from the resource data it found. It | ||
5 | - * should not be modified by hand. | ||
6 | - */ | ||
7 | - | ||
8 | -package com.upc.pbe.upcnews; | ||
9 | - | ||
10 | -public final class R { | ||
11 | - public static final class attr { | ||
12 | - } | ||
13 | - public static final class drawable { | ||
14 | - public static final int ic_action_search=0x7f020000; | ||
15 | - public static final int ic_launcher=0x7f020001; | ||
16 | - public static final int ic_menu_name=0x7f020002; | ||
17 | - } | ||
18 | - public static final class id { | ||
19 | - public static final int AbsoluteLayout1=0x7f08000a; | ||
20 | - public static final int ImageView01=0x7f08000c; | ||
21 | - public static final int ImageView1=0x7f08000b; | ||
22 | - public static final int LinearLayout1=0x7f080001; | ||
23 | - public static final int button=0x7f08000f; | ||
24 | - public static final int button1=0x7f080003; | ||
25 | - public static final int button2=0x7f080004; | ||
26 | - public static final int button3=0x7f080005; | ||
27 | - public static final int button4=0x7f080006; | ||
28 | - public static final int button5=0x7f080007; | ||
29 | - public static final int itemhelp=0x7f080012; | ||
30 | - public static final int itemprefs=0x7f080011; | ||
31 | - public static final int menu_settings=0x7f080010; | ||
32 | - public static final int textView1=0x7f080008; | ||
33 | - public static final int textView2=0x7f080009; | ||
34 | - public static final int textViewRoute=0x7f08000d; | ||
35 | - public static final int textViewTitle=0x7f080002; | ||
36 | - public static final int textViewXml=0x7f08000e; | ||
37 | - public static final int videoView1=0x7f080000; | ||
38 | - } | ||
39 | - public static final class layout { | ||
40 | - public static final int activity_video=0x7f030000; | ||
41 | - public static final int dirs=0x7f030001; | ||
42 | - public static final int help=0x7f030002; | ||
43 | - public static final int main_activity=0x7f030003; | ||
44 | - } | ||
45 | - public static final class menu { | ||
46 | - public static final int activity_main=0x7f070000; | ||
47 | - public static final int activity_video=0x7f070001; | ||
48 | - public static final int menu=0x7f070002; | ||
49 | - } | ||
50 | - public static final class string { | ||
51 | - public static final int app_name=0x7f050000; | ||
52 | - public static final int button=0x7f05000c; | ||
53 | - public static final int button1=0x7f05000d; | ||
54 | - public static final int desc=0x7f050009; | ||
55 | - public static final int descarregar=0x7f050003; | ||
56 | - public static final int dir=0x7f05000a; | ||
57 | - public static final int directoris=0x7f05000b; | ||
58 | - public static final int hello_world=0x7f050010; | ||
59 | - public static final int help=0x7f050008; | ||
60 | - public static final int hint=0x7f050004; | ||
61 | - public static final int logodescription=0x7f05000f; | ||
62 | - public static final int menu_settings=0x7f050001; | ||
63 | - public static final int prefs=0x7f050007; | ||
64 | - public static final int title=0x7f05000e; | ||
65 | - public static final int title_activity_main=0x7f050002; | ||
66 | - public static final int title_activity_video=0x7f050011; | ||
67 | - public static final int url=0x7f050005; | ||
68 | - public static final int urlhint=0x7f050006; | ||
69 | - } | ||
70 | - public static final class style { | ||
71 | - public static final int AppTheme=0x7f060000; | ||
72 | - } | ||
73 | - public static final class xml { | ||
74 | - public static final int prefs=0x7f040000; | ||
75 | - } | ||
76 | -} | 1 | +/* AUTO-GENERATED FILE. DO NOT MODIFY. |
2 | + * | ||
3 | + * This class was automatically generated by the | ||
4 | + * aapt tool from the resource data it found. It | ||
5 | + * should not be modified by hand. | ||
6 | + */ | ||
7 | + | ||
8 | +package com.upc.pbe.upcnews; | ||
9 | + | ||
10 | +public final class R { | ||
11 | + public static final class attr { | ||
12 | + } | ||
13 | + public static final class drawable { | ||
14 | + public static final int ic_action_search=0x7f020000; | ||
15 | + public static final int ic_launcher=0x7f020001; | ||
16 | + public static final int ic_menu_name=0x7f020002; | ||
17 | + } | ||
18 | + public static final class id { | ||
19 | + public static final int AbsoluteLayout1=0x7f08000a; | ||
20 | + public static final int ImageView01=0x7f08000c; | ||
21 | + public static final int ImageView1=0x7f08000b; | ||
22 | + public static final int LinearLayout1=0x7f080001; | ||
23 | + public static final int button=0x7f08000f; | ||
24 | + public static final int button1=0x7f080003; | ||
25 | + public static final int button2=0x7f080004; | ||
26 | + public static final int button3=0x7f080005; | ||
27 | + public static final int button4=0x7f080006; | ||
28 | + public static final int button5=0x7f080007; | ||
29 | + public static final int itemhelp=0x7f080012; | ||
30 | + public static final int itemprefs=0x7f080011; | ||
31 | + public static final int menu_settings=0x7f080010; | ||
32 | + public static final int textView1=0x7f080008; | ||
33 | + public static final int textView2=0x7f080009; | ||
34 | + public static final int textViewRoute=0x7f08000d; | ||
35 | + public static final int textViewTitle=0x7f080002; | ||
36 | + public static final int textViewXml=0x7f08000e; | ||
37 | + public static final int videoView1=0x7f080000; | ||
38 | + } | ||
39 | + public static final class layout { | ||
40 | + public static final int activity_video=0x7f030000; | ||
41 | + public static final int dirs=0x7f030001; | ||
42 | + public static final int help=0x7f030002; | ||
43 | + public static final int main_activity=0x7f030003; | ||
44 | + } | ||
45 | + public static final class menu { | ||
46 | + public static final int activity_main=0x7f070000; | ||
47 | + public static final int activity_video=0x7f070001; | ||
48 | + public static final int menu=0x7f070002; | ||
49 | + } | ||
50 | + public static final class string { | ||
51 | + public static final int app_name=0x7f050000; | ||
52 | + public static final int button=0x7f05000c; | ||
53 | + public static final int button1=0x7f05000d; | ||
54 | + public static final int desc=0x7f050009; | ||
55 | + public static final int descarregar=0x7f050003; | ||
56 | + public static final int dir=0x7f05000a; | ||
57 | + public static final int directoris=0x7f05000b; | ||
58 | + public static final int hello_world=0x7f050010; | ||
59 | + public static final int help=0x7f050008; | ||
60 | + public static final int hint=0x7f050004; | ||
61 | + public static final int logodescription=0x7f05000f; | ||
62 | + public static final int menu_settings=0x7f050001; | ||
63 | + public static final int prefs=0x7f050007; | ||
64 | + public static final int title=0x7f05000e; | ||
65 | + public static final int title_activity_main=0x7f050002; | ||
66 | + public static final int title_activity_video=0x7f050011; | ||
67 | + public static final int url=0x7f050005; | ||
68 | + public static final int urlhint=0x7f050006; | ||
69 | + } | ||
70 | + public static final class style { | ||
71 | + public static final int AppTheme=0x7f060000; | ||
72 | + } | ||
73 | + public static final class xml { | ||
74 | + public static final int prefs=0x7f040000; | ||
75 | + } | ||
76 | +} |
src/com/upc/pbe/upcnews/HLS.java
@@ -2,6 +2,9 @@ package com.upc.pbe.upcnews; | @@ -2,6 +2,9 @@ package com.upc.pbe.upcnews; | ||
2 | 2 | ||
3 | import java.util.ArrayList; | 3 | import java.util.ArrayList; |
4 | 4 | ||
5 | +import com.xuggle.mediatool.IMediaReader; | ||
6 | +import com.xuggle.mediatool.ToolFactory; | ||
7 | + | ||
5 | public class HLS { | 8 | public class HLS { |
6 | 9 | ||
7 | static final String TAG = "HLS"; | 10 | static final String TAG = "HLS"; |
@@ -9,6 +12,7 @@ public class HLS { | @@ -9,6 +12,7 @@ public class HLS { | ||
9 | ArrayList<ParentList> ppls; | 12 | ArrayList<ParentList> ppls; |
10 | int numvideo; | 13 | int numvideo; |
11 | int quality; //0 รฉs la mรฉs alta | 14 | int quality; //0 รฉs la mรฉs alta |
15 | + IMediaReader reader; | ||
12 | 16 | ||
13 | public HLS(ArrayList<ParentList> parsed) | 17 | public HLS(ArrayList<ParentList> parsed) |
14 | { | 18 | { |
@@ -21,7 +25,11 @@ public class HLS { | @@ -21,7 +25,11 @@ public class HLS { | ||
21 | 25 | ||
22 | //Primer vรญdeo que hi hagi, amb la millor qualitat possible | 26 | //Primer vรญdeo que hi hagi, amb la millor qualitat possible |
23 | for(int i = 0 ; i < ppls.get(numvideo).getLists().get(quality).getSegments().size() ; i++){ | 27 | for(int i = 0 ; i < ppls.get(numvideo).getLists().get(quality).getSegments().size() ; i++){ |
24 | - | 28 | + |
29 | + //canviar .ts en .mp4 | ||
30 | + reader = ToolFactory.makeReader(ppls.get(numvideo).getLists().get(quality).getSegments().get(i).getURL()); | ||
31 | + reader.addListener(ToolFactory.makeWriter("output.mov", reader)); | ||
32 | + while (reader.readPacket() == null); | ||
25 | } | 33 | } |
26 | } | 34 | } |
27 | 35 |
src/com/upc/pbe/upcnews/Segment.java
src/com/upc/pbe/upcnews/VideoActivity.java
1 | package com.upc.pbe.upcnews; | 1 | package com.upc.pbe.upcnews; |
2 | 2 | ||
3 | -import com.xuggle.mediatool.IMediaReader; | ||
4 | -import com.xuggle.mediatool.ToolFactory; | ||
5 | - | 3 | +import android.app.Activity; |
6 | import android.net.Uri; | 4 | import android.net.Uri; |
7 | import android.os.Bundle; | 5 | import android.os.Bundle; |
8 | -import android.app.Activity; | ||
9 | import android.view.Menu; | 6 | import android.view.Menu; |
10 | import android.widget.MediaController; | 7 | import android.widget.MediaController; |
11 | import android.widget.VideoView; | 8 | import android.widget.VideoView; |
12 | 9 | ||
10 | +import com.xuggle.mediatool.IMediaReader; | ||
11 | + | ||
13 | public class VideoActivity extends Activity { | 12 | public class VideoActivity extends Activity { |
14 | - | 13 | + |
15 | VideoView video; | 14 | VideoView video; |
16 | String url; | 15 | String url; |
17 | - IMediaReader reader; | ||
18 | 16 | ||
19 | 17 | ||
20 | - @Override | ||
21 | - public void onCreate(Bundle savedInstanceState) { | ||
22 | - super.onCreate(savedInstanceState); | ||
23 | - setContentView(R.layout.activity_video); | ||
24 | - url = "http://imanolbarba.myftp.biz/video.mp4"; | ||
25 | - //url = ((UpcApp) getApplication()).getDesc(); | ||
26 | - | ||
27 | - reader = ToolFactory.makeReader("input.flv"); | ||
28 | - reader.addListener(ToolFactory.makeWriter("output.mov", reader)); | ||
29 | - while(reader.readPacket() == null); | ||
30 | - | ||
31 | - //Creacio del VideoPlayer associat a una URL | ||
32 | - video = (VideoView) findViewById(R.id.videoView1); | ||
33 | - video.setVideoURI(Uri.parse(url)); | ||
34 | - video.setMediaController(new MediaController(this)); | ||
35 | - video.start(); | ||
36 | - video.requestFocus(); | ||
37 | - } | ||
38 | - | ||
39 | - @Override | ||
40 | - public boolean onCreateOptionsMenu(Menu menu) { | ||
41 | - getMenuInflater().inflate(R.menu.activity_video, menu); | ||
42 | - return true; | ||
43 | - } | 18 | + @Override |
19 | + public void onCreate(Bundle savedInstanceState) { | ||
20 | + super.onCreate(savedInstanceState); | ||
21 | + setContentView(R.layout.activity_video); | ||
22 | + url = "http://imanolbarba.myftp.biz/video.mp4"; | ||
23 | + // url = ((UpcApp) getApplication()).getDesc(); | ||
24 | + | ||
25 | + | ||
26 | + | ||
27 | + // Creacio del VideoPlayer associat a una URL | ||
28 | + video = (VideoView) findViewById(R.id.videoView1); | ||
29 | + video.setVideoURI(Uri.parse(url)); | ||
30 | + video.setMediaController(new MediaController(this)); | ||
31 | + video.start(); | ||
32 | + video.requestFocus(); | ||
33 | + } | ||
34 | + | ||
35 | + @Override | ||
36 | + public boolean onCreateOptionsMenu(Menu menu) { | ||
37 | + getMenuInflater().inflate(R.menu.activity_video, menu); | ||
38 | + return true; | ||
39 | + } | ||
44 | } | 40 | } |