Table of Contents

Class VideoPlayer

네임스페이스
easyar

VideoPlayer는 비디오 재생 클래스입니다. EasyAR은 일반 비디오, 투명 비디오 및 스트리밍 재생을 지원합니다. 비디오 콘텐츠는 setRenderTexture로 전달된 텍스처에 렌더링됩니다. 이 클래스는 OpenGLES 3.0 텍스처만 지원합니다. OpenGLES에 대한 의존성으로 인해, 이 클래스의 모든 함수(소멸자 포함)는 OpenGLES 컨텍스트를 포함하는 단일 스레드에서 호출되어야 합니다. 현재 버전에서는 너비와 높이가 모두 16의 배수여야 합니다. 지원되는 비디오 파일 형식 Windows: Media Foundation 호환 형식. 추가 코덱 설치로 더 많은 형식 지원 가능. Supported Media Formats in Media Foundation 참조. DirectShow는 지원하지 않음. Mac: 지원하지 않음. Android: 시스템 지원 형식. Supported media formats 참조. iOS: 시스템 지원 형식. 현재 유효한 참조 문서가 없음.

VideoPlayer

생성자

VideoPlayer

void easyar_VideoPlayer__ctor(easyar_VideoPlayer * * Return)
VideoPlayer()
public VideoPlayer()
constructor()
+ (easyar_VideoPlayer *) create
public convenience init()
public VideoPlayer()

메서드

isAvailable

사용 가능한지 확인합니다. Windows, Android 및 iOS에서만 true를 반환하며, Mac에서는 사용할 수 없습니다.

bool easyar_VideoPlayer_isAvailable(void)
static bool isAvailable()
public static boolean isAvailable()
companion object fun isAvailable(): Boolean
+ (bool)isAvailable
public static func isAvailable() -> Bool
public static bool isAvailable()

반환 값

형식 설명
Boolean

setVideoType

비디오 유형을 설정합니다. 수동으로 설정하지 않으면 기본값으로 일반 유형이 설정됩니다. 이 메서드는 open 전에 호출해야 합니다.

void easyar_VideoPlayer_setVideoType(easyar_VideoPlayer * This, easyar_VideoType videoType)
void setVideoType(VideoType videoType)
public void setVideoType(int videoType)
fun setVideoType(videoType: Int): Unit
- (void)setVideoType:(easyar_VideoType)videoType
public func setVideoType(_ videoType: VideoType) -> Void
public virtual void setVideoType(VideoType videoType)

매개 변수

이름 형식 설명
videoType VideoType

반환 값

형식 설명
Void

setRenderTexture

비디오를 표시하는 데 사용되는 텍스처를 플레이어에 전달합니다. 이 메서드는 open 전에 호출되어야 합니다.

void easyar_VideoPlayer_setRenderTexture(easyar_VideoPlayer * This, easyar_TextureId * texture)
void setRenderTexture(std::shared_ptr<TextureId> texture)
public void setRenderTexture(@Nonnull TextureId texture)
fun setRenderTexture(texture: TextureId): Unit
- (void)setRenderTexture:(easyar_TextureId *)texture
public func setRenderTexture(_ texture: TextureId) -> Void
public virtual void setRenderTexture(TextureId texture)

매개 변수

이름 형식 설명
texture TextureId

반환 값

형식 설명
Void

open

path에서 비디오를 엽니다.
path는 로컬 비디오 파일(path/to/video.mp4) 또는 URL(http://www.../.../video.mp4)일 수 있습니다. storageType은 path의 유형을 나타냅니다. 자세한 내용은 StorageType을 참조하십시오.
이 메서드는 비동기 메서드입니다. open이 완료되려면 시간이 걸릴 수 있습니다. 비디오 열기 결과 또는 재생 상태를 알고 싶다면 callback 데이터를 처리해야 합니다. callback은 callbackScheduler에 해당하는 스레드에서 호출됩니다. 콜백에서 열기가 성공적으로 완료되었는지 확인하고 성공적으로 열린 후 재생을 시작할 수 있습니다.

void easyar_VideoPlayer_open(easyar_VideoPlayer * This, easyar_String * path, easyar_StorageType storageType, easyar_CallbackScheduler * callbackScheduler, easyar_OptionalOfFunctorOfVoidFromVideoStatus callback)
void open(std::string path, StorageType storageType, std::shared_ptr<CallbackScheduler> callbackScheduler, std::optional<std::function<void(VideoStatus)>> callback)
public void open(java.lang.@Nonnull String path, int storageType, @Nonnull CallbackScheduler callbackScheduler, @Nullable FunctorOfVoidFromVideoStatus callback)
fun open(path: String, storageType: Int, callbackScheduler: CallbackScheduler, callback: FunctorOfVoidFromVideoStatus?): Unit
- (void)open:(NSString *)path storageType:(easyar_StorageType)storageType callbackScheduler:(easyar_CallbackScheduler *)callbackScheduler callback:(void (^)(easyar_VideoStatus status))callback
public func `open`(_ path: String, _ storageType: StorageType, _ callbackScheduler: CallbackScheduler, _ callback: ((VideoStatus) -> Void)?) -> Void
public virtual void open(string path, StorageType storageType, CallbackScheduler callbackScheduler, Optional<Action<VideoStatus>> callback)

매개 변수

이름 형식 설명
path String
storageType StorageType
callbackScheduler CallbackScheduler
callback Optional<Action<VideoStatus>>

반환 값

형식 설명
Void

close

비디오를 닫습니다.

void easyar_VideoPlayer_close(easyar_VideoPlayer * This)
void close()
public void close()
fun close(): Unit
- (void)close
public func close() -> Void
public virtual void close()

반환 값

형식 설명
Void

play

비디오 재생을 시작하거나 재개합니다.

bool easyar_VideoPlayer_play(easyar_VideoPlayer * This)
bool play()
public boolean play()
fun play(): Boolean
- (bool)play
public func play() -> Bool
public virtual bool play()

반환 값

형식 설명
Boolean

stop

Stop video playback.

void easyar_VideoPlayer_stop(easyar_VideoPlayer * This)
void stop()
public void stop()
fun stop(): Unit
- (void)stop
public func stop() -> Void
public virtual void stop()

반환 값

형식 설명
Void

pause

동영상 재생 일시정지.

void easyar_VideoPlayer_pause(easyar_VideoPlayer * This)
void pause()
public void pause()
fun pause(): Unit
- (void)pause
public func pause() -> Void
public virtual void pause()

반환 값

형식 설명
Void

isRenderTextureAvailable

비디오 텍스처가 렌더링에 사용될 수 있는지. 전달된 플레이어의 텍스처가 접촉되었는지 확인하는 데 사용할 수 있습니다.

bool easyar_VideoPlayer_isRenderTextureAvailable(easyar_VideoPlayer * This)
bool isRenderTextureAvailable()
public boolean isRenderTextureAvailable()
fun isRenderTextureAvailable(): Boolean
- (bool)isRenderTextureAvailable
public func isRenderTextureAvailable() -> Bool
public virtual bool isRenderTextureAvailable()

반환 값

형식 설명
Boolean

updateFrame

텍스처 데이터를 업데이트합니다. 이 메소드는 isRenderTextureAvailable이 true를 반환할 때 렌더링 스레드에서 호출해야 합니다.

void easyar_VideoPlayer_updateFrame(easyar_VideoPlayer * This)
void updateFrame()
public void updateFrame()
fun updateFrame(): Unit
- (void)updateFrame
public func updateFrame() -> Void
public virtual void updateFrame()

반환 값

형식 설명
Void

duration

비디오 길이를 반환합니다. 성공적인 open 이후에 사용합니다.

int easyar_VideoPlayer_duration(easyar_VideoPlayer * This)
int duration()
public int duration()
fun duration(): Int
- (int)duration
public func duration() -> Int32
public virtual int duration()

반환 값

형식 설명
Int32

currentPosition

현재 재생 중인 비디오 위치를 반환합니다. 성공적인 open 이후에 사용합니다.

int easyar_VideoPlayer_currentPosition(easyar_VideoPlayer * This)
int currentPosition()
public int currentPosition()
fun currentPosition(): Int
- (int)currentPosition
public func currentPosition() -> Int32
public virtual int currentPosition()

반환 값

형식 설명
Int32

seek

재생 위치를 position으로 조정합니다. 성공적인 open 이후에 사용합니다.

bool easyar_VideoPlayer_seek(easyar_VideoPlayer * This, int position)
bool seek(int position)
public boolean seek(int position)
fun seek(position: Int): Boolean
- (bool)seek:(int)position
public func seek(_ position: Int32) -> Bool
public virtual bool seek(int position)

매개 변수

이름 형식 설명
position Int32

반환 값

형식 설명
Boolean

size

동영상 너비와 높이를 반환합니다. 성공적인 open 이후에 사용합니다.

easyar_Vec2I easyar_VideoPlayer_size(easyar_VideoPlayer * This)
Vec2I size()
public @Nonnull Vec2I size()
fun size(): Vec2I
- (easyar_Vec2I *)size
public func size() -> Vec2I
public virtual Vec2I size()

반환 값

형식 설명
Vec2I

volume

비디오 볼륨을 반환합니다. 성공적인 open 이후에 사용하세요.

float easyar_VideoPlayer_volume(easyar_VideoPlayer * This)
float volume()
public float volume()
fun volume(): Float
- (float)volume
public func volume() -> Float
public virtual float volume()

반환 값

형식 설명
Single

setVolume

비디오 볼륨 설정. 성공적인 open 후에 사용.

bool easyar_VideoPlayer_setVolume(easyar_VideoPlayer * This, float volume)
bool setVolume(float volume)
public boolean setVolume(float volume)
fun setVolume(volume: Float): Boolean
- (bool)setVolume:(float)volume
public func setVolume(_ volume: Float) -> Bool
public virtual bool setVolume(float volume)

매개 변수

이름 형식 설명
volume Single

반환 값

형식 설명
Boolean