Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ef0bfa48
authored
Aug 16, 2021
by
olly
Committed by
Oliver Woodman
Aug 17, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove previously deprecated DefaultHttpDataSourceFactory
NO_EXTERNAL PiperOrigin-RevId: 391054962
parent
80d9d47d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
141 deletions
RELEASENOTES.md
demos/cast/src/main/java/com/google/android/exoplayer2/castdemo/PlayerManager.java
library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultHttpDataSourceFactory.java
RELEASENOTES.md
View file @
ef0bfa48
...
...
@@ -37,6 +37,8 @@
`AudioListener`
. Use
`Player.addListener`
and
`Player.Listener`
instead.
*
Remove
`SimpleExoPlayer.addVideoListener`
,
`removeVideoListener`
and
`VideoListener`
. Use
`Player.addListener`
and
`Player.Listener`
instead.
*
Remove
`DefaultHttpDataSourceFactory`
. Use
`DefaultHttpDataSource.Factory`
instead.
### 2.15.0 (2021-08-10)
...
...
demos/cast/src/main/java/com/google/android/exoplayer2/castdemo/PlayerManager.java
View file @
ef0bfa48
...
...
@@ -36,7 +36,6 @@ import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
import
com.google.android.exoplayer2.trackselection.TrackSelectionArray
;
import
com.google.android.exoplayer2.ui.PlayerControlView
;
import
com.google.android.exoplayer2.ui.PlayerView
;
import
com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory
;
import
com.google.android.gms.cast.framework.CastContext
;
import
java.util.ArrayList
;
...
...
@@ -57,10 +56,6 @@ import java.util.ArrayList;
void
onUnsupportedTrack
(
int
trackType
);
}
private
static
final
String
USER_AGENT
=
"ExoCastDemoPlayer"
;
private
static
final
DefaultHttpDataSourceFactory
DATA_SOURCE_FACTORY
=
new
DefaultHttpDataSourceFactory
(
USER_AGENT
);
private
final
PlayerView
localPlayerView
;
private
final
PlayerControlView
castControlView
;
private
final
DefaultTrackSelector
trackSelector
;
...
...
library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultHttpDataSourceFactory.java
deleted
100644 → 0
View file @
80d9d47d
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
google
.
android
.
exoplayer2
.
upstream
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.upstream.HttpDataSource.BaseFactory
;
/** @deprecated Use {@link DefaultHttpDataSource.Factory} instead. */
@Deprecated
public
final
class
DefaultHttpDataSourceFactory
extends
BaseFactory
{
@Nullable
private
final
String
userAgent
;
@Nullable
private
final
TransferListener
listener
;
private
final
int
connectTimeoutMillis
;
private
final
int
readTimeoutMillis
;
private
final
boolean
allowCrossProtocolRedirects
;
/**
* Creates an instance. Sets {@link DefaultHttpDataSource#DEFAULT_CONNECT_TIMEOUT_MILLIS} as the
* connection timeout, {@link DefaultHttpDataSource#DEFAULT_READ_TIMEOUT_MILLIS} as the read
* timeout and disables cross-protocol redirects.
*/
public
DefaultHttpDataSourceFactory
()
{
this
(
/* userAgent= */
null
);
}
/**
* Creates an instance. Sets {@link DefaultHttpDataSource#DEFAULT_CONNECT_TIMEOUT_MILLIS} as the
* connection timeout, {@link DefaultHttpDataSource#DEFAULT_READ_TIMEOUT_MILLIS} as the read
* timeout and disables cross-protocol redirects.
*
* @param userAgent The user agent that will be used, or {@code null} to use the default user
* agent of the underlying platform.
*/
public
DefaultHttpDataSourceFactory
(
@Nullable
String
userAgent
)
{
this
(
userAgent
,
null
);
}
/**
* Creates an instance. Sets {@link DefaultHttpDataSource#DEFAULT_CONNECT_TIMEOUT_MILLIS} as the
* connection timeout, {@link DefaultHttpDataSource#DEFAULT_READ_TIMEOUT_MILLIS} as the read
* timeout and disables cross-protocol redirects.
*
* @param userAgent The user agent that will be used, or {@code null} to use the default user
* agent of the underlying platform.
* @param listener An optional listener.
* @see #DefaultHttpDataSourceFactory(String, TransferListener, int, int, boolean)
*/
public
DefaultHttpDataSourceFactory
(
@Nullable
String
userAgent
,
@Nullable
TransferListener
listener
)
{
this
(
userAgent
,
listener
,
DefaultHttpDataSource
.
DEFAULT_CONNECT_TIMEOUT_MILLIS
,
DefaultHttpDataSource
.
DEFAULT_READ_TIMEOUT_MILLIS
,
false
);
}
/**
* @param userAgent The user agent that will be used, or {@code null} to use the default user
* agent of the underlying platform.
* @param connectTimeoutMillis The connection timeout that should be used when requesting remote
* data, in milliseconds. A timeout of zero is interpreted as an infinite timeout.
* @param readTimeoutMillis The read timeout that should be used when requesting remote data, in
* milliseconds. A timeout of zero is interpreted as an infinite timeout.
* @param allowCrossProtocolRedirects Whether cross-protocol redirects (i.e. redirects from HTTP
* to HTTPS and vice versa) are enabled.
*/
public
DefaultHttpDataSourceFactory
(
@Nullable
String
userAgent
,
int
connectTimeoutMillis
,
int
readTimeoutMillis
,
boolean
allowCrossProtocolRedirects
)
{
this
(
userAgent
,
/* listener= */
null
,
connectTimeoutMillis
,
readTimeoutMillis
,
allowCrossProtocolRedirects
);
}
/**
* @param userAgent The user agent that will be used, or {@code null} to use the default user
* agent of the underlying platform.
* @param listener An optional listener.
* @param connectTimeoutMillis The connection timeout that should be used when requesting remote
* data, in milliseconds. A timeout of zero is interpreted as an infinite timeout.
* @param readTimeoutMillis The read timeout that should be used when requesting remote data, in
* milliseconds. A timeout of zero is interpreted as an infinite timeout.
* @param allowCrossProtocolRedirects Whether cross-protocol redirects (i.e. redirects from HTTP
* to HTTPS and vice versa) are enabled.
*/
public
DefaultHttpDataSourceFactory
(
@Nullable
String
userAgent
,
@Nullable
TransferListener
listener
,
int
connectTimeoutMillis
,
int
readTimeoutMillis
,
boolean
allowCrossProtocolRedirects
)
{
this
.
userAgent
=
userAgent
;
this
.
listener
=
listener
;
this
.
connectTimeoutMillis
=
connectTimeoutMillis
;
this
.
readTimeoutMillis
=
readTimeoutMillis
;
this
.
allowCrossProtocolRedirects
=
allowCrossProtocolRedirects
;
}
// Calls deprecated constructor.
@SuppressWarnings
(
"deprecation"
)
@Override
protected
DefaultHttpDataSource
createDataSourceInternal
(
HttpDataSource
.
RequestProperties
defaultRequestProperties
)
{
DefaultHttpDataSource
dataSource
=
new
DefaultHttpDataSource
(
userAgent
,
connectTimeoutMillis
,
readTimeoutMillis
,
allowCrossProtocolRedirects
,
defaultRequestProperties
);
if
(
listener
!=
null
)
{
dataSource
.
addTransferListener
(
listener
);
}
return
dataSource
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment