Table of Contents

Class VideoPlayer

네임스페이스
easyar

VideoPlayer는 video playback 클래스입니다. EasyAR는 일반 video, 투명 video 및 streaming playback을 지원합니다. video 콘텐츠는 setRenderTexture에 전달된 texture에 렌더링됩니다. 이 클래스는 OpenGLES 3.0 texture만 지원합니다. OpenGLES에 의존하므로 이 클래스의 모든 함수(destructor 포함)는 OpenGLES 컨텍스트를 포함하는 단일 thread에서 호출해야 합니다. 현재 버전은 너비와 높이가 모두 16의 배수여야 합니다. 지원되는 video 파일 형식 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

video 타입을 설정합니다. 수동으로 설정하지 않으면 기본적으로 일반 타입이 사용됩니다. 이 메서드는 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

video 표시에 사용할 texture를 player에 전달합니다. 이 메서드는 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에서 video를 엽니다. path는 로컬 video 파일(path/to/video.mp4) 또는 url(http://www.../.../video.mp4)일 수 있습니다. storageType은 path의 타입을 나타냅니다. 자세한 설명은 StorageType를 참조하십시오. 이 메서드는 asynchronous 메서드입니다. open이 완료되는 데 시간이 걸릴 수 있습니다. video open 결과 또는 playback 상태를 알고 싶으면 callback 데이터를 처리해야 합니다. callback은 callbackScheduler에 해당하는 thread에서 호출됩니다. callback에서 open이 성공적으로 끝났는지 확인하고 성공적으로 열린 후 playback을 시작할 수 있습니다.

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

video를 닫습니다.

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

video playback을 시작하거나 계속합니다.

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

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

video playback을 일시 중지합니다.

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

video texture를 렌더링에 사용할 수 있는지 여부입니다. player에 전달한 texture가 사용되었는지 확인하는 데 사용할 수 있습니다.

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

texture 데이터를 업데이트합니다. 이 메서드는 isRenderTextureAvailable이 true를 반환할 때 rendering thread에서 호출해야 합니다.

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

video 길이를 반환합니다. 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

현재 재생 중인 video 위치를 반환합니다. 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

playback 위치를 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

video 너비와 높이를 반환합니다. 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

video 볼륨을 반환합니다. 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

video 볼륨을 설정합니다. 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