최근에 http서버 호출 시 https로 리다이렉트 하는 작업을 진행했는데
ExoPlayer에서 재생이 되지 않았다..
서버에서 http 링크를 주고 Exoplayer에서 리다이렉트 된 url을 재생해야 하는데.. 그냥 가만히 있는 오류..
이럴 때는.. DefaultHttpDataSourceFactory를 생성할 때 allowCrossProtocolRedirects를 true처리 해주면 된다.
new DefaultHttpDataSourceFactory(AGENT); // 기존 코드, Redirect 동작 안함
new DefaultHttpDataSourceFactory(AGENT, LISTENER, CONNECT_TIMEOUT, READ_TIMEOUT, true); // Redirect 동작
android - ExoPlayer2 - How can I make a HTTP 301 redirect work? - Stack Overflow
ExoPlayer2 - How can I make a HTTP 301 redirect work?
I started using ExoPlayer to stream some audio. All was well until I came across an URL that has a "301 Moved Permanently" redirect. ExoPlayer2 does not handle that by default. I've already seen t...
stackoverflow.com
구글 검색 키워드 Exoplayer redirect url
'Android > Kotlin' 카테고리의 다른 글
RecyclerView에서 3, 4번째 아이템이 제대로 로딩되지 않는 현상 (0) | 2023.01.04 |
---|---|
Button의 Text가 전부 대문자로 나올 때 (0) | 2022.12.01 |
TikXML에서 typeadapter 에러 발생 해결법 (0) | 2022.08.11 |
여러 권한 한번에 요청 (0) | 2022.08.09 |
권한 요청 및 수락 (0) | 2022.08.09 |
댓글