Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ビデオが特定のポイント (ビデオの完了の 1/3、2/3、完了時) に達したときに、プログラムの設定を変更する必要があるプログラムを作成しています。Android には完了用のコールバック メソッドが組み込まれているため、その時点でアクションを実行することは難しくありません。しかし、ビデオが 1/3 と 2/3 の完成度に達した時点を確認する方法がわかりません。
MediaPlayer コントロールを使用すると、メディア ファイルの合計再生時間をミリ秒単位で取得できます。
myMediaPlayer.getDuration()
ビデオの完了の 1/3、2/3、および 3/3 で現在の位置を毎秒チェックするスレッドを実装します。
myMediaPlayer.getCurrentPosition(); //***current Position in milliseconds.