VideoPlayer SWIFT!!! iOS

0 votes
asked Nov 27 by daniil (280 points)

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 textureId to OpaquePointer. The video plays, I hear its sound. But in place of the marker I see a black rectangle.
please see my code

withUnsafeMutablePointer(to: &textureId) { pointer in

    videoPlayer?.setRenderTexture(OpaquePointer(pointer))

}

I tried to use the video player on objective c, and there everything worked perfectly. It not work work on swift. Do you have a ready implementation for the swift for an example? How to set GLuint textureId as OpaquePointer in setRenderTexture?

Thank you.

1 Answer

+1 vote
answered Nov 27 by daniil (280 points)
 
Best answer
I solved this problem

videoPlayer?.setRenderTexture(OpaquePointer(UnsafeRawPointer(bitPattern: Int(textureId))!))
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...