<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>androidx.media3</title>
	<atom:link href="https://bps-e.com/dev/tag/androidx-media3/feed/" rel="self" type="application/rss+xml" />
	<link>https://bps-e.com/dev</link>
	<description>android アプリ開発 kotlin + jetpack compose + material 3</description>
	<lastBuildDate>Sat, 09 Sep 2023 00:32:36 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>

<image>
	<url>https://bps-e.com/dev/wp-content/uploads/2022/10/cropped-logo3-32x32.png</url>
	<title>androidx.media3</title>
	<link>https://bps-e.com/dev</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>[Android] 022. 動画再生 Exo Player(androidx.media3)</title>
		<link>https://bps-e.com/dev/android-003-022/</link>
		
		<dc:creator><![CDATA[bps-e]]></dc:creator>
		<pubDate>Tue, 29 Aug 2023 22:37:47 +0000</pubDate>
				<category><![CDATA[Dolphin]]></category>
		<category><![CDATA[Giraffe]]></category>
		<category><![CDATA[Jetpack Compose]]></category>
		<category><![CDATA[Kotlin]]></category>
		<category><![CDATA[androidx.media3]]></category>
		<category><![CDATA[Exo Player]]></category>
		<guid isPermaLink="false">https://bps-e.com/dev/?p=865</guid>

					<description><![CDATA[androidx.media3のExo Playerで動画再生を試してみました media3の最新バージョンは1.2.0-alpha01で安定版は1.1.1です現時点ではdeveloperの説明の日本語版は更新されてない [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>androidx.media3のExo Playerで動画再生を試してみました</p>



<p>media3の最新バージョンは1.2.0-alpha01で安定版は1.1.1です<br>現時点ではdeveloperの説明の日本語版は更新されてないので英語版で確認してください<br><a rel="noopener" href="https://developer.android.com/jetpack/androidx/releases/media3" target="_blank">https://developer.android.com/jetpack/androidx/releases/media3</a></p>



<p>Exo Playerも日本語版は更新されてないので英語版で確認してください<br><a rel="noopener" href="https://developer.android.com/guide/topics/media/exoplayer" target="_blank">https://developer.android.com/guide/topics/media/exoplayer</a></p>



<p>StyledPlayerViewはmedia3ではandroidx.media3.ui.PlayerViewに変わったようです<br><a rel="noopener" href="https://developer.android.com/guide/topics/media/exoplayer/mappings#class-renamings" target="_blank">https://developer.android.com/guide/topics/media/exoplayer/mappings#class-renamings</a></p>



<p>使い方はdevloper blogが参考になるかもです<br><a rel="noopener" href="https://android-developers.googleblog.com/2023/03/media3-is-ready-to-play.html" target="_blank">https://android-developers.googleblog.com/2023/03/media3-is-ready-to-play.html</a></p>



<div style="height:var(--wp--preset--spacing--50)" aria-hidden="true" class="wp-block-spacer"></div>



<p>とりあえず最もシンプルな構成で実装</p>



<p>androidx.media3:media3-exoplayer / androidx.media3:media3-uiをimplementationしてください<br>動画はdevloperのサンプルで使用されていたもの、アクセスするのにインターネットのパーミッションの設定もしてください</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-kt" data-lang="Kotlin"><code>// &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&gt;
@Composable
fun VideoPlayerView(modifier: Modifier = Modifier) {
    val context = LocalContext.current
    val url = &quot;https://storage.googleapis.com/exoplayer-test-media-0/play.mp3&quot;
    val exoPlayer = remember {
        ExoPlayer.Builder(context).build().apply {
            setMediaItem(MediaItem.fromUri(url))
            prepare()
            play()
        }
    }

    DisposableEffect(
        AndroidView(
            modifier = modifier,
            factory = {
                PlayerView(context).apply {
                    player = exoPlayer
                }
            }
        )
    ) {
        onDispose {
            exoPlayer.release()
        }
    }
}</code></pre></div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="has-text-align-right">Android Studio Giraffe 2022.3.1 Patch 1 built on August 17, 2023</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
