Bonjour à tous,

Voila je développe une application composé d'un visuel, des questions sur le visuel, et en cliquant sur les questions on a les réponses dans une vue avec texte, image et vidéo.
Le texte et l'image s'affiche sans problème, par contre la vidéo ne s'affiche pas.
Pour cela j'utilise VideoView, je procède de la même manière que pour l'ImageView qui fonctionne, mais ça ne marche pas.
Et je n'ai pas d'erreurs dans le logcat.
Voila si quelqu'un peut jeter un oeil et me dire ce qui ne va pas dans mon code.
Merci d'avance.
Voila mon code:

main.xml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:id="@+id/RelativeLayout1"
	android:layout_width="fill_parent"
	android:layout_height="fill_parent"
	android:orientation="vertical" >
 
	<android.opengl.GLSurfaceView
		android:id="@+id/glSurface"
		android:layout_width="fill_parent"
		android:layout_height="fill_parent" />
 
	<LinearLayout
		android:id="@+id/LinearLayout1"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_alignParentBottom="true"
		android:layout_alignParentRight="true"
		android:layout_alignParentTop="true"
		android:orientation="vertical" >
 
		<ListView
			android:id="@+id/listView1"
			android:layout_width="300dp"
			android:layout_height="500dp"
			android:layout_marginBottom="4dp" >
		</ListView>
 
		<RelativeLayout
			android:id="@+id/RelativeLayout2"
			android:layout_width="match_parent"
			android:layout_height="200dp"
			android:layout_marginBottom="2dp"
			android:layout_marginRight="2dp"
			android:layout_marginTop="4dp "
			android:keepScreenOn="true"
			android:visibility="visible" >
		</RelativeLayout>
	</LinearLayout>
 
	<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
		android:id="@+id/ScrollView1"
    android:layout_width="960dp" 
    android:layout_height="700dp" 
    android:background="#ffffff">
		<LinearLayout
		android:id="@+id/LinearLayout2"
		android:layout_width="950dp"
		android:layout_height="680dp"
		android:layout_alignParentLeft="true"
		android:layout_alignParentTop="true"
		android:layout_marginLeft="10dp"
		android:layout_marginTop="10dp"
		android:background="#ffffff"
		android:orientation="vertical" android:isScrollContainer="true" android:scrollbarAlwaysDrawVerticalTrack="true" android:scrollbars="vertical">
 
		<RelativeLayout
			android:id="@+id/buttonParentLayout"
			android:layout_width="match_parent"
			android:layout_height="31dp" >
 
			<Button
				android:id="@+id/button1"
				style="?android:attr/buttonStyleSmall"
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:layout_alignParentBottom="true"
				android:text="Fermer"  android:layout_alignParentRight="true"/>
 
		</RelativeLayout>
 
 
		<ImageView
			android:id="@+id/imageviewTest"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:src="@drawable/ic_launcher" />
 
		<VideoView
			android:id="@+id/videoView1"
			android:layout_width="match_parent"
			android:layout_height="wrap_content" />
 
	</LinearLayout>
	</ScrollView>
</RelativeLayout>
Et voila mon Main.java
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
 
public class Main extends Activity{
 
	GLSurfaceView surfaceView;
	static Model model = null;
	InputStream is=null;
	GestureDetector aGestureDetector;
	GestureDetector aGestureDetector3D;
	GestureDetector aNavigatorGestureListener;
	ImageView imgView=null;
	ImageView recTransparent=null;
	MyGLRenderer glRenderer=null;
	Renderer3D glRenderer3d=null;
	float xFactor;
	private ListView lv=null;	
	View inflatedView;
	ScaleGestureDetector mScaleDetector=null;
	Context context = null;
	WebView webView =null; 
	NavigatorView aNavigator=null;
	boolean mExternalStorageAvailable = false;
	boolean mExternalStorageWriteable = false;
	ArrayAdapter<Information> lvAdapter;
	PageWeb pageWeb;
	String baseUrl;
	private ArrayList<Information> selectedQuestions;
	ZoneView zoneView;
	LinearLayout LinearLayout1;
	MediaPlayer mediaPlayer;
	MediasView mediaView;
	LinearLayout mediasLayout;
	RelativeLayout buttonParentLayout;
	Button btnFermer;
	VideoView myVideoView;
	SurfaceView surfaceView1;
	SurfaceHolder surfaceHolder;
 
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);          
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.main);
        context = this.getBaseContext();                
 
 
        Log.d("DataDirectory",Environment.getDataDirectory().toString());
    	baseUrl =Environment.getExternalStorageDirectory()+"/Projet";
    	final String rootPath1= Environment.getExternalStorageDirectory()+"/Projet";
 
    	mediasLayout=(LinearLayout) findViewById(R.id.LinearLayout2);
    	mediasLayout.setVisibility(View.GONE);
 
 
    	final ScrollView ScrollView1 = (ScrollView) findViewById(R.id.ScrollView1);
    	ScrollView1.setVisibility(View.GONE);
    	buttonParentLayout = (RelativeLayout) findViewById(R.id.buttonParentLayout);
 
    	btnFermer = (Button) findViewById(R.id.button1);
    	btnFermer.setOnTouchListener(new OnTouchListener() {
			public boolean onTouch(View arg0, MotionEvent arg1) {
 
				ScrollView1.setVisibility(View.GONE);
				return true;
			}
        });
 
 
        surfaceView = (GLSurfaceView) this.findViewById(R.id.glSurface);
 
        lv = (ListView) this.findViewById(R.id.listView1);
        lvAdapter = new ArrayAdapter<Information>(this,android.R.layout.simple_list_item_1,model.getQuestions());
        lv.setAdapter(lvAdapter);
 
        lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        	public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
        	    Object o = lv.getItemAtPosition(position);
        	    Information article =(Information) lv.getItemAtPosition(position);
            	TextView questionView = new TextView(context);
            	questionView.setText(article.toString());
 
            	TextView reponseView = new TextView(context);
            	reponseView.setText(article.getINFORMATION());
 
            	ArrayList<ImageView> imageViews = new ArrayList<ImageView>();
            	ArrayList<VideoView> videoViews = new ArrayList<VideoView>();
 
            	int nbrImg = article.getMEDIAS().size();
            	TextView nbrMedias = new TextView(context);
            	nbrMedias.setText(""+nbrImg);
            	int nbrimg =0;
            	int nbrvideo =0;
 
            	for (int i=0;i<article.getMEDIAS().size();i++){
            		Media media = article.getMEDIAS().get(i);
            		if (media.getMediaType()=="IMAGE") {
            			nbrimg++;
 
            			String imgPath = media.getUri();
        				String strTab[]=imgPath.split("/");
 
        				String newImgPath = rootPath1 + imgPath + "/"+strTab[3];        				
        				FileInputStream in;
        		        BufferedInputStream buf;
                		Log.d("newImgPath 2  : ",newImgPath);
 
        		        ImageView image = new ImageView(context);
        		        try {
        		       	    in = new FileInputStream(newImgPath);
        		            buf = new BufferedInputStream(in);
        		            Bitmap bMap = BitmapFactory.decodeStream(buf);
        		            image.setImageBitmap(bMap);
 
        		         	imageViews.add(image);
        		            if (in != null) {
        		         	in.close();
        		            }
        		            if (buf != null) {
        		         	buf.close();
        		            }
        		        } catch (Exception e) {
        		            Log.e("Error reading file1", e.toString());
        		        }
 
            		}
 
            		if (media.getMediaType()=="VIDEO") {
            			nbrvideo++;
            			String vidPath = media.getUri();
        				String strTab[]=vidPath.split("/");        				
        				String newVidPath = rootPath1 + vidPath + "/"+strTab[3];        				
                		Log.d("VideoImgPath   : ",newVidPath);
 
                		   myVideoView = (VideoView)findViewById(R.id.videoView1);
                	       myVideoView.setVideoURI(Uri.parse(newVidPath));
 
                	       myVideoView.setMediaController(new MediaController(context));
                	       myVideoView.requestFocus();
                	       videoViews.add(myVideoView);
 
 
 
            		}
 
 
            	}
 
 
            	mediasLayout.removeAllViews();
            	mediasLayout.removeView(questionView);
 
            	mediasLayout.addView(buttonParentLayout);
            	mediasLayout.addView(questionView);
            	mediasLayout.addView(reponseView);
 
            	for(int i=0;i<imageViews.size();i++) {
            		ImageView imgView = imageViews.get(i);
            		mediasLayout.addView(imgView);
            	}
 
 
 
            	for(int i=0;i<videoViews.size();i++) {
            		VideoView videoView=videoViews.get(i);
            		mediasLayout.addView(videoView);
            		//videoView.start();
            		Log.d("VideoViews ","videoViews : "+videoViews.size());
            	}
 
 
 
    	    	mediasLayout.setVisibility(View.VISIBLE);
    	    	ScrollView1.setVisibility(View.VISIBLE);
 
        	  }
        	});
 
 
      glRenderer = new MyGLRenderer(this,model);
      surfaceView.setRenderer(glRenderer); 
      aGestureDetector = new GestureDetector(this, new glSurfaceListener(context,model, lv,lvAdapter,webView,aNavigator));
      mScaleDetector = new ScaleGestureDetector(this, new glSurfaceListener(context,model,lv,lvAdapter,webView,aNavigator));      		
 
 
    }