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. OOT: peringatan Tsunami berakhit

Syukurlah tsunami jepang tdk begitu berpengaruh ke indonesia

@ocumudo
pm : o...@robotijo.org



-- 
===============

2. Salam kenal n WTS Nexian Journey :D

Salam Kenal om tante semua,

Saya Abdu dari pasar minggu...baru pakai android sejak tahun
baru...dan sudah mw meninggalkan memakai BB :p
Sekalian saya mw jual Nexian Journey saya, sudah Froyo Cmod+antigores
+memory 2 Giga V-gen, jual 1.4 jt, prefer COD saja di Kalibata Mall
atau Pejaten Village, japri aja ya, alasan jual karena sudah megangin
Tante Defy klo hujan pas B2W jd gak usah susah2 plastikin HP
hehehe...mohon bimbingannya

Salam
Abdu Shebubakar

-- 
===============

3. Direct DNS lookup

4. Change the text style according to state, in XML

5. cursor vlaue to list view

6. How To Recreate WindowManager$BadTokenException ?

7. CVE-2009-1185 and CVE-2010-EASY patches