exoplayer-textureview, 用于TextureView的ExoPlayer的包装器

分享于 

4分钟阅读

GitHub

 
ExoPlayer's wrapper for using with TextureView.
  • 源代码名称:exoplayer-textureview
  • 源代码网址:http://www.github.com/satorufujiwara/exoplayer-textureview
  • exoplayer-textureview源代码文档
  • exoplayer-textureview源代码下载
  • Git URL:
    git://www.github.com/satorufujiwara/exoplayer-textureview.git
    Git Clone代码到本地:
    git clone http://www.github.com/satorufujiwara/exoplayer-textureview
    Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/satorufujiwara/exoplayer-textureview
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    
    exoplayer-textureview

    LicenseDownload

    用于TextureView的ExoPlayer 包装器。

    exoplayer的版本是 r1.5.11

    特性
    • 播放HLS播放列表
    • 在资产文件夹中播放本地视频。
    • 设置比特率限制
    • 静音/非静音
    Gradle
    repositories {
     jcenter()
    }
    dependencies {
     compile 'jp.satorufujiwara:exoplayer-textureview:0.6.9' compile 'com.google.android.exoplayer:exoplayer:r1.5.11'}
    用法

    创建 VideoTexturePresenter 实例并绑定到 Fragment 或者 Activity 生命周期的。

    @Overridepublicvoid onViewCreated(View view, @NullableBundle savedInstanceState) {
     super.onViewCreated(view, savedInstanceState);
     videoTexturePresenter =newVideoTexturePresenter(videoTextureView);
     videoTexturePresenter.onCreate();
     VideoSource source =HlsVideoSource. newBuilder(Uri.parse("hls playlist url."), "UserAgent")
    . bufferSegmentSize(64*1024)
    . bufferSegmentCount(512)
    . build();
     videoTexturePresenter.setSource(source);
     videoTexturePresenter.prepare();
    }@Overridepublicvoid onDestroyView() {
     videoTexturePresenter.release();
     videoTexturePresenter.onDestroy();
     super.onDestroyView();
    }

    播放或者暂停。

    videoTexturePresenter.play();
    videoTexturePresenter.seekTo(0);
    videoTexturePresenter.setMute(true);
    videoTexturePresenter.pause();

    许可证

    
    Copyright 2015 Satoru Fujiwara
    
    
    
    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.
    
    
    
    

    ExoPlayer和ExoPlayer演示。

    
    Copyright (C) 2014 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.
    
    
    
    

    文本  TEX  WRAP  换行  纹理  Exoplayer  
    相关文章