Class VideoPlayer
- 名前空間
- easyar
VideoPlayer は動画再生クラスです。 EasyAR は通常動画、透明動画、ストリーミング再生をサポートします。動画コンテンツは setRenderTexture に渡された texture にレンダリングされます。 このクラスは OpenGLES 3.0 の texture のみをサポートします。 OpenGLES に依存しているため、このクラスのすべての関数(destructor を含む)は、OpenGLES コンテキストを含む単一の thread で呼び出す必要があります。 現在のバージョンでは、幅と高さの両方が 16 の倍数である必要があります。 サポートされる動画ファイル形式 Windows: Media Foundation 互換形式。追加のデコーダーをインストールすると、より多くの形式をサポートできます。Supported Media Formats in Media Foundation を参照してください。DirectShow はサポートされません。 Mac: サポートされません。 Android: システムがサポートする形式。Supported media formats を参照してください。 iOS: システムがサポートする形式。現在、有効な参照ドキュメントはありません。
コンストラクター
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
動画表示に使用する 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 から動画を開きます。 path はローカル動画ファイル(path/to/video.mp4)または url(http://www.../.../video.mp4)にできます。storageType は path のタイプを示します。詳細は StorageType を参照してください。 このメソッドは asynchronous です。open の完了には時間がかかる場合があります。動画を開いた結果や再生中の状態を知りたい場合は、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
動画を閉じます。
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
動画 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
動画 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
動画 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
動画 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
動画の長さを返します。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 |