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

動画の再生を停止します。

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