In VideoPlayer i can't use setRenderTexture() in Swift

+1 vote
asked Oct 16, 2017 by daniil108 (330 points)
retagged Oct 16, 2017 by daniil108

Hi, I'm trying to use swift sdk, but I had a problem with working with a VideoPlayer.
I use:

public func setRenderTexture(_ texture: OpaquePointer) -> Void

But i cant convert texture id to OpaquePointer. The video plays, I hear its sound. But in place of the marker I see a black rectangle.
please see my code

var pointer:UnsafePointer<GLuint> = UnsafePointer([texture_id])
video_player?.setRenderTexture(OpaquePointer(pointer)).


Please tell me, how to set GLuint textureId as OpaquePointer in setRenderTexture.
Thank you.

2 Answers

0 votes
answered Nov 27, 2017 by daniil (320 points)
I solved this problem

videoPlayer?.setRenderTexture(OpaquePointer(UnsafeRawPointer(bitPattern: Int(textureId))!))
commented Nov 28, 2017 by yannick (430 points)
Nice. Thanks to you.  Did you manage to make it all work... I'm stuck with a EXC_BAD_ACCESS on the glDrawElements and I don't see why.
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...