1<!DOCTYPE HTML> 2<!-- NewPage --> 3<html lang="en"> 4<head><!-- start favicons snippet, use https://realfavicongenerator.net/ --><link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png"><link rel="manifest" href="/assets/site.webmanifest"><link rel="mask-icon" href="/assets/safari-pinned-tab.svg" color="#fc4d50"><link rel="shortcut icon" href="/assets/favicon.ico"><meta name="msapplication-TileColor" content="#ffc40d"><meta name="msapplication-config" content="/assets/browserconfig.xml"><meta name="theme-color" content="#ffffff"><!-- end favicons snippet --> 5<title>MediaSource.Factory (ExoPlayer library)</title> 6<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 7<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> 8<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style"> 9<script type="text/javascript" src="../../../../../script.js"></script> 10<script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script> 11<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> 12<!--[if IE]> 13<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> 14<![endif]--> 15<script type="text/javascript" src="../../../../../jquery/jquery-3.5.1.js"></script> 16<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script> 17</head> 18<body> 19<script type="text/javascript"><!-- 20 try { 21 if (location.href.indexOf('is-external=true') == -1) { 22 parent.document.title="MediaSource.Factory (ExoPlayer library)"; 23 } 24 } 25 catch(err) { 26 } 27//--> 28var data = {"i0":6,"i1":6,"i2":6,"i3":6}; 29var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; 30var altColor = "altColor"; 31var rowColor = "rowColor"; 32var tableTab = "tableTab"; 33var activeTableTab = "activeTableTab"; 34var pathtoroot = "../../../../../"; 35var useModuleDirectories = false; 36loadScripts(document, 'script');</script> 37<noscript> 38<div>JavaScript is disabled on your browser.</div> 39</noscript> 40<header role="banner"> 41<nav role="navigation"> 42<div class="fixedNav"> 43<!-- ========= START OF TOP NAVBAR ======= --> 44<div class="topNav"><a id="navbar.top"> 45<!-- --> 46</a> 47<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> 48<a id="navbar.top.firstrow"> 49<!-- --> 50</a> 51<ul class="navList" title="Navigation"> 52<li><a href="../../../../../index.html">Overview</a></li> 53<li><a href="package-summary.html">Package</a></li> 54<li class="navBarCell1Rev">Class</li> 55<li><a href="package-tree.html">Tree</a></li> 56<li><a href="../../../../../deprecated-list.html">Deprecated</a></li> 57<li><a href="../../../../../index-all.html">Index</a></li> 58<li><a href="../../../../../help-doc.html">Help</a></li> 59</ul> 60</div> 61<div class="subNav"> 62<ul class="navList" id="allclasses_navbar_top"> 63<li><a href="../../../../../allclasses.html">All Classes</a></li> 64</ul> 65<ul class="navListSearch"> 66<li><label for="search">SEARCH:</label> 67<input type="text" id="search" value="search" disabled="disabled"> 68<input type="reset" id="reset" value="reset" disabled="disabled"> 69</li> 70</ul> 71<div> 72<script type="text/javascript"><!-- 73 allClassesLink = document.getElementById("allclasses_navbar_top"); 74 if(window==top) { 75 allClassesLink.style.display = "block"; 76 } 77 else { 78 allClassesLink.style.display = "none"; 79 } 80 //--> 81</script> 82<noscript> 83<div>JavaScript is disabled on your browser.</div> 84</noscript> 85</div> 86<div> 87<ul class="subNavList"> 88<li>Summary: </li> 89<li>Nested | </li> 90<li><a href="#field.summary">Field</a> | </li> 91<li>Constr | </li> 92<li><a href="#method.summary">Method</a></li> 93</ul> 94<ul class="subNavList"> 95<li>Detail: </li> 96<li><a href="#field.detail">Field</a> | </li> 97<li>Constr | </li> 98<li><a href="#method.detail">Method</a></li> 99</ul> 100</div> 101<a id="skip.navbar.top"> 102<!-- --> 103</a></div> 104<!-- ========= END OF TOP NAVBAR ========= --> 105</div> 106<div class="navPadding"> </div> 107<script type="text/javascript"><!-- 108$('.navPadding').css('padding-top', $('.fixedNav').css("height")); 109//--> 110</script> 111</nav> 112</header> 113<!-- ======== START OF CLASS DATA ======== --> 114<main role="main"> 115<div class="header"> 116<div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">com.google.android.exoplayer2.source</a></div> 117<h2 title="Interface MediaSource.Factory" class="title">Interface MediaSource.Factory</h2> 118</div> 119<div class="contentContainer"> 120<div class="description"> 121<ul class="blockList"> 122<li class="blockList"> 123<dl> 124<dt>All Known Subinterfaces:</dt> 125<dd><code><a href="MediaSourceFactory.html" title="interface in com.google.android.exoplayer2.source">MediaSourceFactory</a></code></dd> 126</dl> 127<dl> 128<dt>All Known Implementing Classes:</dt> 129<dd><code><a href="dash/DashMediaSource.Factory.html" title="class in com.google.android.exoplayer2.source.dash">DashMediaSource.Factory</a></code>, <code><a href="DefaultMediaSourceFactory.html" title="class in com.google.android.exoplayer2.source">DefaultMediaSourceFactory</a></code>, <code><a href="../testutil/FakeMediaSourceFactory.html" title="class in com.google.android.exoplayer2.testutil">FakeMediaSourceFactory</a></code>, <code><a href="hls/HlsMediaSource.Factory.html" title="class in com.google.android.exoplayer2.source.hls">HlsMediaSource.Factory</a></code>, <code><a href="../ext/ima/ImaServerSideAdInsertionMediaSource.Factory.html" title="class in com.google.android.exoplayer2.ext.ima">ImaServerSideAdInsertionMediaSource.Factory</a></code>, <code><a href="ProgressiveMediaSource.Factory.html" title="class in com.google.android.exoplayer2.source">ProgressiveMediaSource.Factory</a></code>, <code><a href="rtsp/RtspMediaSource.Factory.html" title="class in com.google.android.exoplayer2.source.rtsp">RtspMediaSource.Factory</a></code>, <code><a href="smoothstreaming/SsMediaSource.Factory.html" title="class in com.google.android.exoplayer2.source.smoothstreaming">SsMediaSource.Factory</a></code></dd> 130</dl> 131<dl> 132<dt>Enclosing interface:</dt> 133<dd><a href="MediaSource.html" title="interface in com.google.android.exoplayer2.source">MediaSource</a></dd> 134</dl> 135<hr> 136<pre>public static interface <span class="typeNameLabel">MediaSource.Factory</span></pre> 137<div class="block">Factory for creating <a href="MediaSource.html" title="interface in com.google.android.exoplayer2.source"><code>MediaSources</code></a> from <a href="../MediaItem.html" title="class in com.google.android.exoplayer2"><code>MediaItems</code></a>.</div> 138</li> 139</ul> 140</div> 141<div class="summary"> 142<ul class="blockList"> 143<li class="blockList"> 144<!-- =========== FIELD SUMMARY =========== --> 145<section role="region"> 146<ul class="blockList"> 147<li class="blockList"><a id="field.summary"> 148<!-- --> 149</a> 150<h3>Field Summary</h3> 151<table class="memberSummary"> 152<caption><span>Fields</span><span class="tabEnd"> </span></caption> 153<tr> 154<th class="colFirst" scope="col">Modifier and Type</th> 155<th class="colSecond" scope="col">Field</th> 156<th class="colLast" scope="col">Description</th> 157</tr> 158<tr class="altColor"> 159<td class="colFirst"><code>static <a href="MediaSource.Factory.html" title="interface in com.google.android.exoplayer2.source">MediaSource.Factory</a></code></td> 160<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#UNSUPPORTED">UNSUPPORTED</a></span></code></th> 161<td class="colLast"> 162<div class="block">An instance that throws <a href="https://developer.android.com/reference/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang" class="externalLink"><code>UnsupportedOperationException</code></a> from <a href="#createMediaSource(com.google.android.exoplayer2.MediaItem)" target="_top"><code>createMediaSource(com.google.android.exoplayer2.MediaItem)</code></a> 163 and <a href="#getSupportedTypes()"><code>getSupportedTypes()</code></a>.</div> 164</td> 165</tr> 166</table> 167</li> 168</ul> 169</section> 170<!-- ========== METHOD SUMMARY =========== --> 171<section role="region"> 172<ul class="blockList"> 173<li class="blockList"><a id="method.summary"> 174<!-- --> 175</a> 176<h3>Method Summary</h3> 177<table class="memberSummary"> 178<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption> 179<tr> 180<th class="colFirst" scope="col">Modifier and Type</th> 181<th class="colSecond" scope="col">Method</th> 182<th class="colLast" scope="col">Description</th> 183</tr> 184<tr id="i0" class="altColor"> 185<td class="colFirst"><code><a href="MediaSource.html" title="interface in com.google.android.exoplayer2.source">MediaSource</a></code></td> 186<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#createMediaSource(com.google.android.exoplayer2.MediaItem)">createMediaSource</a></span>​(<a href="../MediaItem.html" title="class in com.google.android.exoplayer2">MediaItem</a> mediaItem)</code></th> 187<td class="colLast"> 188<div class="block">Creates a new <a href="MediaSource.html" title="interface in com.google.android.exoplayer2.source"><code>MediaSource</code></a> with the specified <a href="../MediaItem.html" title="class in com.google.android.exoplayer2"><code>MediaItem</code></a>.</div> 189</td> 190</tr> 191<tr id="i1" class="rowColor"> 192<td class="colFirst"><code>@com.google.android.exoplayer2.C.ContentType int[]</code></td> 193<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSupportedTypes()">getSupportedTypes</a></span>()</code></th> 194<td class="colLast"> 195<div class="block">Returns the <a href="../C.ContentType.html" title="annotation in com.google.android.exoplayer2"><code>content types</code></a> supported by media sources created by this 196 factory.</div> 197</td> 198</tr> 199<tr id="i2" class="altColor"> 200<td class="colFirst"><code><a href="MediaSource.Factory.html" title="interface in com.google.android.exoplayer2.source">MediaSource.Factory</a></code></td> 201<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setDrmSessionManagerProvider(com.google.android.exoplayer2.drm.DrmSessionManagerProvider)">setDrmSessionManagerProvider</a></span>​(<a href="../drm/DrmSessionManagerProvider.html" title="interface in com.google.android.exoplayer2.drm">DrmSessionManagerProvider</a> drmSessionManagerProvider)</code></th> 202<td class="colLast"> 203<div class="block">Sets the <a href="../drm/DrmSessionManagerProvider.html" title="interface in com.google.android.exoplayer2.drm"><code>DrmSessionManagerProvider</code></a> used to obtain a <a href="../drm/DrmSessionManager.html" title="interface in com.google.android.exoplayer2.drm"><code>DrmSessionManager</code></a> for a 204 <a href="../MediaItem.html" title="class in com.google.android.exoplayer2"><code>MediaItem</code></a>.</div> 205</td> 206</tr> 207<tr id="i3" class="rowColor"> 208<td class="colFirst"><code><a href="MediaSource.Factory.html" title="interface in com.google.android.exoplayer2.source">MediaSource.Factory</a></code></td> 209<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setLoadErrorHandlingPolicy(com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy)">setLoadErrorHandlingPolicy</a></span>​(<a href="../upstream/LoadErrorHandlingPolicy.html" title="interface in com.google.android.exoplayer2.upstream">LoadErrorHandlingPolicy</a> loadErrorHandlingPolicy)</code></th> 210<td class="colLast"> 211<div class="block">Sets an optional <a href="../upstream/LoadErrorHandlingPolicy.html" title="interface in com.google.android.exoplayer2.upstream"><code>LoadErrorHandlingPolicy</code></a>.</div> 212</td> 213</tr> 214</table> 215</li> 216</ul> 217</section> 218</li> 219</ul> 220</div> 221<div class="details"> 222<ul class="blockList"> 223<li class="blockList"> 224<!-- ============ FIELD DETAIL =========== --> 225<section role="region"> 226<ul class="blockList"> 227<li class="blockList"><a id="field.detail"> 228<!-- --> 229</a> 230<h3>Field Detail</h3> 231<a id="UNSUPPORTED"> 232<!-- --> 233</a> 234<ul class="blockListLast"> 235<li class="blockList"> 236<h4>UNSUPPORTED</h4> 237<pre>static final <a href="MediaSource.Factory.html" title="interface in com.google.android.exoplayer2.source">MediaSource.Factory</a> UNSUPPORTED</pre> 238<div class="block">An instance that throws <a href="https://developer.android.com/reference/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang" class="externalLink"><code>UnsupportedOperationException</code></a> from <a href="#createMediaSource(com.google.android.exoplayer2.MediaItem)" target="_top"><code>createMediaSource(com.google.android.exoplayer2.MediaItem)</code></a> 239 and <a href="#getSupportedTypes()"><code>getSupportedTypes()</code></a>.</div> 240</li> 241</ul> 242</li> 243</ul> 244</section> 245<!-- ============ METHOD DETAIL ========== --> 246<section role="region"> 247<ul class="blockList"> 248<li class="blockList"><a id="method.detail"> 249<!-- --> 250</a> 251<h3>Method Detail</h3> 252<a id="setDrmSessionManagerProvider(com.google.android.exoplayer2.drm.DrmSessionManagerProvider)"> 253<!-- --> 254</a> 255<ul class="blockList"> 256<li class="blockList"> 257<h4>setDrmSessionManagerProvider</h4> 258<pre class="methodSignature"><a href="MediaSource.Factory.html" title="interface in com.google.android.exoplayer2.source">MediaSource.Factory</a> setDrmSessionManagerProvider​(@Nullable 259 <a href="../drm/DrmSessionManagerProvider.html" title="interface in com.google.android.exoplayer2.drm">DrmSessionManagerProvider</a> drmSessionManagerProvider)</pre> 260<div class="block">Sets the <a href="../drm/DrmSessionManagerProvider.html" title="interface in com.google.android.exoplayer2.drm"><code>DrmSessionManagerProvider</code></a> used to obtain a <a href="../drm/DrmSessionManager.html" title="interface in com.google.android.exoplayer2.drm"><code>DrmSessionManager</code></a> for a 261 <a href="../MediaItem.html" title="class in com.google.android.exoplayer2"><code>MediaItem</code></a>. 262 263 <p>If not set, <a href="../drm/DefaultDrmSessionManagerProvider.html" title="class in com.google.android.exoplayer2.drm"><code>DefaultDrmSessionManagerProvider</code></a> is used.</div> 264<dl> 265<dt><span class="returnLabel">Returns:</span></dt> 266<dd>This factory, for convenience.</dd> 267</dl> 268</li> 269</ul> 270<a id="setLoadErrorHandlingPolicy(com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy)"> 271<!-- --> 272</a> 273<ul class="blockList"> 274<li class="blockList"> 275<h4>setLoadErrorHandlingPolicy</h4> 276<pre class="methodSignature"><a href="MediaSource.Factory.html" title="interface in com.google.android.exoplayer2.source">MediaSource.Factory</a> setLoadErrorHandlingPolicy​(@Nullable 277 <a href="../upstream/LoadErrorHandlingPolicy.html" title="interface in com.google.android.exoplayer2.upstream">LoadErrorHandlingPolicy</a> loadErrorHandlingPolicy)</pre> 278<div class="block">Sets an optional <a href="../upstream/LoadErrorHandlingPolicy.html" title="interface in com.google.android.exoplayer2.upstream"><code>LoadErrorHandlingPolicy</code></a>.</div> 279<dl> 280<dt><span class="paramLabel">Parameters:</span></dt> 281<dd><code>loadErrorHandlingPolicy</code> - A <a href="../upstream/LoadErrorHandlingPolicy.html" title="interface in com.google.android.exoplayer2.upstream"><code>LoadErrorHandlingPolicy</code></a>, or <code>null</code> to use the 282 <a href="../upstream/DefaultLoadErrorHandlingPolicy.html" title="class in com.google.android.exoplayer2.upstream"><code>DefaultLoadErrorHandlingPolicy</code></a>.</dd> 283<dt><span class="returnLabel">Returns:</span></dt> 284<dd>This factory, for convenience.</dd> 285</dl> 286</li> 287</ul> 288<a id="getSupportedTypes()"> 289<!-- --> 290</a> 291<ul class="blockList"> 292<li class="blockList"> 293<h4>getSupportedTypes</h4> 294<pre class="methodSignature"><a href="../C.ContentType.html" title="annotation in com.google.android.exoplayer2">@ContentType</a> 295@com.google.android.exoplayer2.C.ContentType int[] getSupportedTypes()</pre> 296<div class="block">Returns the <a href="../C.ContentType.html" title="annotation in com.google.android.exoplayer2"><code>content types</code></a> supported by media sources created by this 297 factory.</div> 298</li> 299</ul> 300<a id="createMediaSource(com.google.android.exoplayer2.MediaItem)"> 301<!-- --> 302</a> 303<ul class="blockListLast"> 304<li class="blockList"> 305<h4>createMediaSource</h4> 306<pre class="methodSignature"><a href="MediaSource.html" title="interface in com.google.android.exoplayer2.source">MediaSource</a> createMediaSource​(<a href="../MediaItem.html" title="class in com.google.android.exoplayer2">MediaItem</a> mediaItem)</pre> 307<div class="block">Creates a new <a href="MediaSource.html" title="interface in com.google.android.exoplayer2.source"><code>MediaSource</code></a> with the specified <a href="../MediaItem.html" title="class in com.google.android.exoplayer2"><code>MediaItem</code></a>.</div> 308<dl> 309<dt><span class="paramLabel">Parameters:</span></dt> 310<dd><code>mediaItem</code> - The media item to play.</dd> 311<dt><span class="returnLabel">Returns:</span></dt> 312<dd>The new <a href="MediaSource.html" title="interface in com.google.android.exoplayer2.source"><code>media source</code></a>.</dd> 313</dl> 314</li> 315</ul> 316</li> 317</ul> 318</section> 319</li> 320</ul> 321</div> 322</div> 323</main> 324<!-- ========= END OF CLASS DATA ========= --> 325<footer role="contentinfo"> 326<nav role="navigation"> 327<!-- ======= START OF BOTTOM NAVBAR ====== --> 328<div class="bottomNav"><a id="navbar.bottom"> 329<!-- --> 330</a> 331<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> 332<a id="navbar.bottom.firstrow"> 333<!-- --> 334</a> 335<ul class="navList" title="Navigation"> 336<li><a href="../../../../../index.html">Overview</a></li> 337<li><a href="package-summary.html">Package</a></li> 338<li class="navBarCell1Rev">Class</li> 339<li><a href="package-tree.html">Tree</a></li> 340<li><a href="../../../../../deprecated-list.html">Deprecated</a></li> 341<li><a href="../../../../../index-all.html">Index</a></li> 342<li><a href="../../../../../help-doc.html">Help</a></li> 343</ul> 344</div> 345<div class="subNav"> 346<ul class="navList" id="allclasses_navbar_bottom"> 347<li><a href="../../../../../allclasses.html">All Classes</a></li> 348</ul> 349<div> 350<script type="text/javascript"><!-- 351 allClassesLink = document.getElementById("allclasses_navbar_bottom"); 352 if(window==top) { 353 allClassesLink.style.display = "block"; 354 } 355 else { 356 allClassesLink.style.display = "none"; 357 } 358 //--> 359</script> 360<noscript> 361<div>JavaScript is disabled on your browser.</div> 362</noscript> 363</div> 364<div> 365<ul class="subNavList"> 366<li>Summary: </li> 367<li>Nested | </li> 368<li><a href="#field.summary">Field</a> | </li> 369<li>Constr | </li> 370<li><a href="#method.summary">Method</a></li> 371</ul> 372<ul class="subNavList"> 373<li>Detail: </li> 374<li><a href="#field.detail">Field</a> | </li> 375<li>Constr | </li> 376<li><a href="#method.detail">Method</a></li> 377</ul> 378</div> 379<a id="skip.navbar.bottom"> 380<!-- --> 381</a></div> 382<!-- ======== END OF BOTTOM NAVBAR ======= --> 383</nav> 384</footer> 385</body> 386</html> 387