Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_26386469
GSYVideoPlayer
提交
74982a46
G
GSYVideoPlayer
项目概览
qq_26386469
/
GSYVideoPlayer
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
GSYVideoPlayer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
74982a46
编写于
5月 21, 2019
作者:
G
guoshuyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加 allowCrossProtocolRedirects 支持
上级
59e6253f
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
16 addition
and
5 deletion
+16
-5
app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java
...rc/main/java/com/example/gsyvideoplayer/DetailPlayer.java
+2
-1
gsyVideoPlayer-exo_player2/src/main/java/tv/danmaku/ijk/media/exo2/ExoSourceManager.java
...main/java/tv/danmaku/ijk/media/exo2/ExoSourceManager.java
+14
-4
未找到文件。
app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java
浏览文件 @
74982a46
...
...
@@ -84,12 +84,13 @@ public class DetailPlayer extends AppCompatActivity {
Map
<
String
,
String
>
header
=
new
HashMap
<>();
header
.
put
(
"ee"
,
"33"
);
header
.
put
(
"allowCrossProtocolRedirects"
,
"true"
);
GSYVideoOptionBuilder
gsyVideoOption
=
new
GSYVideoOptionBuilder
();
gsyVideoOption
.
setThumbImageView
(
imageView
)
.
setIsTouchWiget
(
true
)
.
setRotateViewAuto
(
false
)
.
setLockLand
(
false
)
.
setAutoFullWithSize
(
tru
e
)
.
setAutoFullWithSize
(
fals
e
)
.
setShowFullAnimation
(
false
)
.
setNeedLockFull
(
true
)
.
setUrl
(
url
)
...
...
gsyVideoPlayer-exo_player2/src/main/java/tv/danmaku/ijk/media/exo2/ExoSourceManager.java
浏览文件 @
74982a46
...
...
@@ -3,7 +3,10 @@ package tv.danmaku.ijk.media.exo2;
import
android.annotation.SuppressLint
;
import
android.content.Context
;
import
android.net.Uri
;
import
androidx.annotation.Nullable
;
import
tv.danmaku.ijk.media.exo2.source.GSYExoHttpDataSource
;
import
tv.danmaku.ijk.media.exo2.source.GSYExoHttpDataSourceFactory
;
import
android.text.TextUtils
;
...
...
@@ -230,6 +233,7 @@ public class ExoSourceManager {
/**
* 设置https忽略证书
*
* @param skipSSLChain true时是hulve
*/
public
static
void
setSkipSSLChain
(
boolean
skipSSLChain
)
{
...
...
@@ -259,9 +263,14 @@ public class ExoSourceManager {
}
private
DataSource
.
Factory
getHttpDataSourceFactory
(
Context
context
,
boolean
preview
)
{
if
(
mSkipSSLChain
)
{
boolean
allowCrossProtocolRedirects
=
false
;
if
(
mMapHeadData
!=
null
&&
mMapHeadData
.
size
()
>
0
)
{
allowCrossProtocolRedirects
=
"true"
.
equals
(
mMapHeadData
.
get
(
"allowCrossProtocolRedirects"
));
}
if
(
mSkipSSLChain
)
{
GSYExoHttpDataSourceFactory
dataSourceFactory
=
new
GSYExoHttpDataSourceFactory
(
Util
.
getUserAgent
(
context
,
TAG
),
preview
?
null
:
new
DefaultBandwidthMeter
());
TAG
),
preview
?
null
:
new
DefaultBandwidthMeter
(),
GSYExoHttpDataSource
.
DEFAULT_CONNECT_TIMEOUT_MILLIS
,
GSYExoHttpDataSource
.
DEFAULT_READ_TIMEOUT_MILLIS
,
allowCrossProtocolRedirects
);
if
(
mMapHeadData
!=
null
&&
mMapHeadData
.
size
()
>
0
)
{
for
(
Map
.
Entry
<
String
,
String
>
header
:
mMapHeadData
.
entrySet
())
{
dataSourceFactory
.
getDefaultRequestProperties
().
set
(
header
.
getKey
(),
header
.
getValue
());
...
...
@@ -270,7 +279,8 @@ public class ExoSourceManager {
return
dataSourceFactory
;
}
DefaultHttpDataSourceFactory
dataSourceFactory
=
new
DefaultHttpDataSourceFactory
(
Util
.
getUserAgent
(
context
,
TAG
),
preview
?
null
:
new
DefaultBandwidthMeter
());
TAG
),
preview
?
null
:
new
DefaultBandwidthMeter
(),
GSYExoHttpDataSource
.
DEFAULT_CONNECT_TIMEOUT_MILLIS
,
GSYExoHttpDataSource
.
DEFAULT_READ_TIMEOUT_MILLIS
,
allowCrossProtocolRedirects
);
if
(
mMapHeadData
!=
null
&&
mMapHeadData
.
size
()
>
0
)
{
for
(
Map
.
Entry
<
String
,
String
>
header
:
mMapHeadData
.
entrySet
())
{
dataSourceFactory
.
getDefaultRequestProperties
().
set
(
header
.
getKey
(),
header
.
getValue
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录