@@ -201,12 +201,13 @@ static MediaSource maybeBuildLiveMediaSource(final PlayerDataSource dataSource,
201201
202202 try {
203203 final StreamInfoTag tag = StreamInfoTag .of (info );
204- if (!info .getHlsUrl ().isEmpty ()) {
205- return buildLiveMediaSource (dataSource , info .getHlsUrl (), C .CONTENT_TYPE_HLS , tag );
206- } else if (!info .getDashMpdUrl ().isEmpty ()) {
204+ if (!info .getDashMpdUrl ().isEmpty ()) {
207205 return buildLiveMediaSource (
208206 dataSource , info .getDashMpdUrl (), C .CONTENT_TYPE_DASH , tag );
209207 }
208+ if (!info .getHlsUrl ().isEmpty ()) {
209+ return buildLiveMediaSource (dataSource , info .getHlsUrl (), C .CONTENT_TYPE_HLS , tag );
210+ }
210211 } catch (final Exception e ) {
211212 Log .w (TAG , "Error when generating live media source, falling back to standard sources" ,
212213 e );
@@ -225,7 +226,11 @@ static MediaSource buildLiveMediaSource(final PlayerDataSource dataSource,
225226 factory = dataSource .getLiveSsMediaSourceFactory ();
226227 break ;
227228 case C .CONTENT_TYPE_DASH :
228- factory = dataSource .getLiveDashMediaSourceFactory ();
229+ if (metadata .getServiceId () == ServiceList .YouTube .getServiceId ()) {
230+ factory = dataSource .getLiveYoutubeDashMediaSourceFactory ();
231+ } else {
232+ factory = dataSource .getLiveDashMediaSourceFactory ();
233+ }
229234 break ;
230235 case C .CONTENT_TYPE_HLS :
231236 factory = dataSource .getLiveHlsMediaSourceFactory ();
0 commit comments