Skip to content

Activity is null if use VLCVideoLayout on Fragment

Activity is NULL in org.videolan.libvlc.VideoHelper.java:193 if use VLCVideoLayout with Fragment:

image

It happens because the context of mVideoSurfaceFrame is not an instance of Activity. In that case, the context has been wrapped into ContextWrapper and it can be fixed like this:

image