Display (and position) video on top of other graphical content

by Daniel » Wed, 17 Mar 2010 01:08:15 GMT


Sponsored Links
 Hi,

I need to display video (using the MediaPlayer API) on top of other
graphical content. I currently do this the following way:

* Create one subclass of SurfaceView, and render graphics to it using
Canvas.drawBitmap.
* Create another subclass of SurfaceView, and associate a MediaPlayer
with it using MediaPlayer.setDisplay(holder), where holder is the
SurfaceHolder of the SurfaceView.
* Add both SurfaceViews to my Activity using addContentView.

This basically works; the video is displayed on top of the graphical
content and plays ok. Some problems though:

1) According to Google, multiple SurfaceViews are not supposed to be
used in a window. The fact that it works for me seems to be by chance,
and behaviour could change in future versions of Android.

2) The video is placed in the upper left corner, and I haven't found a
way to position it differently.

Any suggestions on a different approach to implement this, that would
not make use of multiple surface views, and also allow me to position
the video, would be much appreciated.

Thanks,
Daniel

--



Other Threads

1. Resuming View with about 200KB of drawable resources: android.view.InflateException and java.lang.OutOfMemoryError

A 1000x1000 32 bits image takes 4 MB in RAM :)







> 

2. Kejadian tadi malam

Buat temen2 semua, 

Gw mau cerita sedikit kejadian yg td mlm gw alamin. Mau sekedar share aja, 
takutnya ada yg ngalamin juga. 

Kemaren gw ke apt Marbela kemang karena mau numpang mandi di salah satu unit 
milik teman. Pas keluar sekitar jam 6.30 mlm, di parkiran gw menyadari ada yg 
aneh. Ada 3 org mencurigakan dan terlihat seperti polisi berpakaian preman, knp 
gw nyimpulin begitu?soalnya salah satu ada yg bawa HT. Tp gw pikir bukan apa2. 
Setelah gw jalanin mobil, gw menyadari kok org2 yg sama ngikutin gw dr 
belakang?? Gw mengarah ke bangka yg keluar si tendean. Disini kejadian mulai 
aneh. Tiba2  salah satu dr mereka keluar mobil, jalan ke arah mobil gw dan dgn 
tiba2 ngeluarin kamera dan memfoto gw dan mobil gw!! Aneh kan? Jujur gw makin 
takut. Gw langsung coba menghindar tanpa bikin gerakan2 aneh. Tetep santai. 
Mobilnya makin mepet. Kanan, kiri, seakan akan mau ngeliat muka gw. Disaat itu 
langsung gw inisiatif mau ke kntor temen gw di hang lekir karena lagi rame plus 
isinya crew band yg badannya gede2. 

Tapi akhirnya mobil itu berhenti dan ga ikutin lagi di depan subur jalab 
wolter. Gw jujur sampe skrg jd takut. Gw siaran mlm di ratu plaza. Masih parno 
ngebayangin itu apa yg gw alamin. 
Sekedar info, mobilnya adalah avanza blue donker dgn stiker seluruh mobil kaya 
motif bank danamon. 

Mau share aja. Semoga ga akan terjadi apa apa dan temen2 yg lain juga waspada. 
Gw masih belum tau ini sebenernya apa. Tapi ga ada salahnya utk ati2. 

Makasih atas waktunya utk baca email ini. 

-- 
"Indonesian Android Community [id-android]" 

3. Mod: Siapa mau mewakili id-android PULSA SummerCamp 2010

4. Problem with Intent.

5. Sedang diusahakan ke Sabtu, Mod: X10 Launching - Seminar/Gathering Id-Android Jumat 16 April 2010

6. Run an application on server

7. Autocomplete