私はExoPlayerで再生したいres/raw
フォルダにdog.mp4ビデオファイルを持っています。私はExoPlayer開発者ガイド(https://google.github.io/ExoPlayer/guide.html)からのコード行のためのビデオURIを取得する方法を把握しようとしている:ExoPlayer 2.xのローカルビデオを取得する方法
MediaSource videoSource = new ExtractorMediaSource(mp4VideoUri,
dataSourceFactory, extractorsFactory, null, null);
それを得るために、私はこの行を使用します。また、試してみました
Uri mp4VideoUri = Uri.parse("android.resources://"+getPackageName()+"/"+R.raw.dog);
この構文:android.resource://[package]/[res type]/[res name]
しかしSimpleExoPlayerView
は黒のままで、私は次のエラーを取得:
com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: Unable to connect to android.resources://lt.wilkas.deleteexoplayer/2131099648
を
私は間違って何をしていますか?
また、簡単なチュートリアルでExoPlayerでローカルビデオを再生する方法もありがとうございます。デベロッパーサイトのデモアプリは、すべてを把握するのにはかなり複雑です。 – wilkas