Está en la página 1de 4

UT05: Utilización de librerías multimedia integradas.

Programación Móviles y Dispositivos Multimedia.

Rubén Molina Galache

1
Contents
1 Librería Integrada de Audio & Video. 3
1.1 Librería Audio. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Librería Video. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Obtención de Recursos. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3.1 Almacenamiento Externo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3.2 Internet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Librería Animaciones. 4
2.1 Animaciones por Interpolación. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Animaciones por Fotogramas. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2
1 Librería Integrada de Audio & Video.
1.1 Librería Audio.
MediaPlayer sonido;
MediaController controles;

sonido = MediaPlayer.create(this, R.raw.music);


controles = new MediaController(this);
controles.setMediaPlayer(this);
controles.setAnchorView(findViewById(R.id.idControles));

1.2 Librería Video.


VideoView video;
MediaController controles;

video = (VideoView) findViewById(R.id.VideoView);


controles = new MediaController(this);
video.setMediaController(controles);

1.3 Obtención de Recursos.


1.3.1 Almacenamiento Externo.
Uri path = Uri.parse(this.getExternalFilesDir(Enviromment.DIRECTORY_MOVIES) + "/fichero_video.mp4");
video.setVideoURI(path);
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"/>

1.3.2 Internet
Uri path = Uri.parse("https://www.url.com/video.mp4");
video.setVideoURI(path);
<uses-permission android:name="android.permission.INTERNET"/>
android:usesCleartextTraffic="true"

3
2 Librería Animaciones.
2.1 Animaciones por Interpolación.
botar.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:interpolator="@android:anim/accelerate_interpolator"
android:repeatCount="infinite"
android:repeatMode="reverse"
android:fromYDelta="0%p"
android:toYDelta="80%p"
android:duration="1000"/>
</set>

2.2 Animaciones por Fotogramas.

También podría gustarte