android - How to clear SurfaceTexture after using it with a MediaPlayer? -
android - How to clear SurfaceTexture after using it with a MediaPlayer? -
i'm using listview textureview children. textureview uses mediaplayer play videos. when textureview gets recycled, lastly frame remains on surface until next mediaplayer makes utilize of it.
what easiest way "clear" textureview's surface (e.g black) old frames not appear?
after struggling while, i've come couple of possible solutions:
a) clear surface using gles. can see illustration in grafika (check out clearsurface() method). i'm not fan of because don't think jarring transition black looks particularly good, , it's fair bit of technical overhead if aren't using gl code. additionally, seems work api 17+.
b) chosen solution create new textureview , add together appropriate view every time wanted play video, instead of reusing old one. hesitate phone call good solution, it's to the lowest degree horrible 1 find.
c) 1 thing might able if you're playing same video 1 time again seek seek first frame of video when it's done playing. next time lastly frame flashes, won't visible since same frame origin of video. had success couldn't work reliably on devices. it's pretty hack.
good luck, immensely frustrating seek fix.
android textureview
Comments
Post a Comment