Autore Topic: Play di un file video  (Letto 1759 volte)

Offline akus85

  • Nuovo arrivato
  • *
  • Post: 25
  • Respect: 0
    • akus85
    • Mostra profilo
    • BitOverflow.it
  • Dispositivo Android:
    Galaxy Nexus S
  • Play Store ID:
    akus.py
  • Sistema operativo:
    Mac OS
Play di un file video
« il: 08 Dicembre 2010, 21:12:06 CET »
0
Salve,
sto provando a far partire un video che sta nella cartella /res/raw/ solo che mi da come messaggio 'Impossibile riprodurre il video'

main.xml
Codice (XML): [Seleziona]
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"><VideoView android:id="@+id/VideoView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></VideoView>
</LinearLayout>

VideoPlayer.java
Codice (Java): [Seleziona]
package it.VideoPlayer;

import android.app.Activity;
import android.os.Bundle;
import android.widget.VideoView;

public class VideoPlayer extends Activity {
        /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        VideoView videoView = (VideoView)findViewById(R.id.VideoView01);
        videoView.setVideoPath("res/raw/video.mov");
        videoView.start();
    }
   
}

il logcat mi da quest'errore :


Offline Qlimax

  • Moderatore globale
  • Utente senior
  • *****
  • Post: 757
  • Respect: +203
    • Google+
    • _Qlimax
    • Mostra profilo
    • www.egsolutions.ch
  • Dispositivo Android:
    Galaxy Nexus - Nexus One - Wildfire - Magic
  • Play Store ID:
    egsolutions.ch
  • Sistema operativo:
    Ubuntu 12.04, Windows 7
Re:Play di un file video
« Risposta #1 il: 08 Dicembre 2010, 22:32:45 CET »
0

Offline akus85

  • Nuovo arrivato
  • *
  • Post: 25
  • Respect: 0
    • akus85
    • Mostra profilo
    • BitOverflow.it
  • Dispositivo Android:
    Galaxy Nexus S
  • Play Store ID:
    akus.py
  • Sistema operativo:
    Mac OS
Re:Play di un file video
« Risposta #2 il: 08 Dicembre 2010, 23:00:37 CET »
0
Ah quindi e' solo un problema di formato..grazie adesso faccio delle prove!  ;-)

Offline akus85

  • Nuovo arrivato
  • *
  • Post: 25
  • Respect: 0
    • akus85
    • Mostra profilo
    • BitOverflow.it
  • Dispositivo Android:
    Galaxy Nexus S
  • Play Store ID:
    akus.py
  • Sistema operativo:
    Mac OS
Re:Play di un file video
« Risposta #3 il: 27 Dicembre 2010, 11:08:46 CET »
0
Ritorno a postare perchè ancora non sono riuscito a risolvere...ho convertito il video infatti lo riesco a visualizzare nel Galaxy Tab con il player predefinito ma se provo col codice postato sopra ottengo sempre lo stesso messaggio : 'Impossibile riprodurre il video'
Il Logcat completo è questo:
Codice: [Seleziona]
12-27 11:05:04.331: DEBUG/AndroidRuntime(398): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
12-27 11:05:04.331: DEBUG/AndroidRuntime(398): CheckJNI is ON
12-27 11:05:04.560: DEBUG/AndroidRuntime(398): --- registering native functions ---
12-27 11:05:05.431: DEBUG/AndroidRuntime(398): Shutting down VM
12-27 11:05:05.431: DEBUG/dalvikvm(398): Debugger has detached; object registry had 1 entries
12-27 11:05:05.461: INFO/AndroidRuntime(398): NOTE: attach of thread 'Binder Thread #3' failed
12-27 11:05:06.001: DEBUG/dalvikvm(372): GC_EXPLICIT freed 1313 objects / 89984 bytes in 968ms
12-27 11:05:06.091: DEBUG/AndroidRuntime(406): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
12-27 11:05:06.091: DEBUG/AndroidRuntime(406): CheckJNI is ON
12-27 11:05:06.331: DEBUG/AndroidRuntime(406): --- registering native functions ---
12-27 11:05:07.171: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=it.Video1/.Video1ADT }
12-27 11:05:07.241: DEBUG/AndroidRuntime(406): Shutting down VM
12-27 11:05:07.251: DEBUG/dalvikvm(406): Debugger has detached; object registry had 1 entries
12-27 11:05:07.341: INFO/AndroidRuntime(406): NOTE: attach of thread 'Binder Thread #3' failed
12-27 11:05:07.941: INFO/StagefrightPlayer(34): setDataSource('res/raw/video.mov')
12-27 11:05:07.981: INFO/ActivityManager(59): Displayed activity it.Video1/.Video1ADT: 762 ms (total 762 ms)
12-27 11:05:08.011: ERROR/MediaPlayer(372): error (1, -2147483648)
12-27 11:05:08.161: ERROR/MediaPlayer(372): Error (1,-2147483648)
12-27 11:05:08.161: DEBUG/VideoView(372): Error: 1,-2147483648
12-27 11:05:12.751: WARN/InputManagerService(59): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43fc7530
12-27 11:05:13.801: DEBUG/dalvikvm(125): GC_EXPLICIT freed 741 objects / 39656 bytes in 83ms

dove sbaglio ?  :-o

Offline Qlimax

  • Moderatore globale
  • Utente senior
  • *****
  • Post: 757
  • Respect: +203
    • Google+
    • _Qlimax
    • Mostra profilo
    • www.egsolutions.ch
  • Dispositivo Android:
    Galaxy Nexus - Nexus One - Wildfire - Magic
  • Play Store ID:
    egsolutions.ch
  • Sistema operativo:
    Ubuntu 12.04, Windows 7
Re:Play di un file video
« Risposta #4 il: 27 Dicembre 2010, 15:09:15 CET »
0
12-27 11:05:07.941: INFO/StagefrightPlayer(34): setDataSource('res/raw/video.mov')


Offline akus85

  • Nuovo arrivato
  • *
  • Post: 25
  • Respect: 0
    • akus85
    • Mostra profilo
    • BitOverflow.it
  • Dispositivo Android:
    Galaxy Nexus S
  • Play Store ID:
    akus.py
  • Sistema operativo:
    Mac OS
Re:Play di un file video
« Risposta #5 il: 27 Dicembre 2010, 16:43:21 CET »
0
Ho sistemato il codice ma il problema persiste :

Video1ADT.java
Codice (Java): [Seleziona]
package it.Video1;

import android.app.Activity;
import android.os.Bundle;
import android.widget.VideoView;

public class Video1ADT extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        VideoView videoView = (VideoView)findViewById(R.id.VideoView01);
        videoView.setVideoPath("res/raw/prova3.mp4");
        videoView.start();
    }
}

main.xml
Codice (XML): [Seleziona]
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
             android:layout_width="fill_parent"
             android:layout_height="fill_parent"
             xmlns:android="http://schemas.android.com/apk/res/android">
             
              <VideoView android:id="@+id/VideoView01"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"></VideoView>
                         
</LinearLayout>

Logcat:
Codice: [Seleziona]
12-27 16:42:52.005: DEBUG/AndroidRuntime(564): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
12-27 16:42:52.005: DEBUG/AndroidRuntime(564): CheckJNI is ON
12-27 16:42:52.405: DEBUG/AndroidRuntime(564): --- registering native functions ---
12-27 16:42:53.955: DEBUG/AndroidRuntime(564): Shutting down VM
12-27 16:42:53.955: DEBUG/dalvikvm(564): Debugger has detached; object registry had 1 entries
12-27 16:42:53.975: INFO/AndroidRuntime(564): NOTE: attach of thread 'Binder Thread #3' failed
12-27 16:42:54.614: DEBUG/AndroidRuntime(572): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
12-27 16:42:54.614: DEBUG/AndroidRuntime(572): CheckJNI is ON
12-27 16:42:54.874: DEBUG/AndroidRuntime(572): --- registering native functions ---
12-27 16:42:55.825: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=it.Video1/.Video1ADT }
12-27 16:42:56.015: DEBUG/AndroidRuntime(572): Shutting down VM
12-27 16:42:56.065: DEBUG/dalvikvm(572): Debugger has detached; object registry had 1 entries
12-27 16:42:56.145: INFO/AndroidRuntime(572): NOTE: attach of thread 'Binder Thread #3' failed
12-27 16:42:56.225: INFO/ActivityManager(59): Start proc it.Video1 for activity it.Video1/.Video1ADT: pid=579 uid=10035 gids={}
12-27 16:42:57.464: INFO/StagefrightPlayer(34): setDataSource('res/raw/prova3.mp4')
12-27 16:42:57.504: ERROR/MediaPlayer(579): error (1, -2147483648)
12-27 16:42:57.534: INFO/ActivityManager(59): Displayed activity it.Video1/.Video1ADT: 1514 ms (total 1514 ms)
12-27 16:42:57.614: ERROR/MediaPlayer(579): Error (1,-2147483648)
12-27 16:42:57.635: DEBUG/VideoView(579): Error: 1,-2147483648
12-27 16:42:58.935: DEBUG/dalvikvm(159): GC_EXPLICIT freed 1757 objects / 87184 bytes in 3133ms
12-27 16:43:05.134: DEBUG/dalvikvm(133): GC_EXPLICIT freed 3740 objects / 181784 bytes in 105ms