VideoPlayer SWIFT!!! iOS

0 votes
asked Nov 27, 2017 by daniil (320 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.

2 Answers

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

videoPlayer?.setRenderTexture(OpaquePointer(UnsafeRawPointer(bitPattern: Int(textureId))!))
0 votes
answered Aug 2, 2018 by sbeck27 (700 points)
If I use the proposed solution:

videoPlayer?.setRenderTexture(OpaquePointer(UnsafeRawPointer(bitPattern: Int(textureId))!))

I still see a black rectangle. Any ideas why? Albert do you now anything, or do you have a Video Render File I can compare to?

Greetings, Sven
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...