GithubHelp home page GithubHelp logo

Comments (13)

CarGuo avatar CarGuo commented on July 4, 2024

不是很理解,我这边不处理实际业务需求

from gsyvideoplayer.

AlceZhang avatar AlceZhang commented on July 4, 2024

不好意思,有点着急,不是描述的很清楚。首先我这边用的是ViewPager2来实现的(全屏),使用ConcatenatingMediaSource方式来无缝切换下一集,当我滑动列表时,调用了next()方法播放下一集,但并不是在我当前显示的页面播放,而是在离屏的那个页面进行了下一集播放。我想请教下,如何将下一集的内容显示在我当前的页面或者如何将mSurface切换到当前显示页面,还是有其他方式,不知道此番描述是否清楚,望回复~

from gsyvideoplayer.

CarGuo avatar CarGuo commented on July 4, 2024

简单来说这个实现不合理,你调用 next 的地方是在上一页的 view ,按照这个思路 gsy 上是无法支持你这种实现

from gsyvideoplayer.

AlceZhang avatar AlceZhang commented on July 4, 2024

好的,感谢您的及时回复,已知晓。为了实现滑动无缝切换(预加载),已经试过了DetailDownloadPlayer方式与DetailExoListPlayer ,因为现使用是M3u8,所以DetailDownloadPlayer方式的代理缓存不支持。DetailExoListPlayer 方式又满足不了需要,所以现在只剩下多播放器来实现嘛

from gsyvideoplayer.

CarGuo avatar CarGuo commented on July 4, 2024

新版本你更新了一个 DetailDownloadExoPlayer ,可以大概了解下

from gsyvideoplayer.

AlceZhang avatar AlceZhang commented on July 4, 2024

已使用。感谢~

from gsyvideoplayer.

AlceZhang avatar AlceZhang commented on July 4, 2024

你好,再次打扰。现在使用DetailDownloadExoPlayer 方式缓存m3u8,但是我看缓存的文件大小都只有4kb左右看状态就提示缓存成功了。第一个问题,针对m3u8的视频,都是缓存这么大小嘛? 第二个问题,后面缓存中更多的出现缓存失败,异常提示 ”IllegalStateException Task failed: null:56c6bd9cd341bd6fc18a37debe8e2b48, false“

from gsyvideoplayer.

CarGuo avatar CarGuo commented on July 4, 2024

exo 的缓存是分很多分片区完成的,不会是和源文件一样,至于错误从log上看不出来,目前这个 demo 只是一个示例参考,具体可能需要你自己调试下,比如用它的 Service 模式

from gsyvideoplayer.

AlceZhang avatar AlceZhang commented on July 4, 2024

是的,m3u8是分很多分片完成的。但是我还有一个疑问,m3u8不支持setCacheWithPlay(true)的设置,我的理解是当设置了setCacheWithPlay(true)时,会先根据这个设置缓存的路径读取缓存文件,如果没有则请求网络。但是m3u8设置setCacheWithPlay后会无法播放,我看此方法的注释也是不支持m3u8。所以,它的如何去读取缓存的呢?注释:已设置 : PlayerFactory.setPlayManager(Exo2PlayerManager::class.java)
CacheFactory.setCacheManager(ExoPlayerCacheManager::class.java)

from gsyvideoplayer.

CarGuo avatar CarGuo commented on July 4, 2024

不,我的意思是,ExoPlayerCacheManager 就算是一个mp4文件,它也会分成无数小段落进行缓存

from gsyvideoplayer.

AlceZhang avatar AlceZhang commented on July 4, 2024

哦,那就缓存模式区别,跟文件类型无关。但我这还是没有针对M3u8格式文件的预缓存方式实现方式。楼上你说使用 Service 模式方式,是指DownloadService嘛?还有请教下,您觉得针对m3u8格式的文件,做一个类似抖音的效果,为了流畅,使用预加载,gsy有什么比较组合的模式嘛?(这几天我把各种缓存方式都看了一遍,好像对MP4合适的比较友好)

from gsyvideoplayer.

CarGuo avatar CarGuo commented on July 4, 2024

m3u8 其实不适合类似(抖音)模式做缓存,因为你考虑一下,如果其中某个 ts 异常,或者缓存出现 seek ,然后来回切换的时候,这个就很尴尬。

抖音模式主要是提前缓存视频的前几秒内容,你需要一个额外的全局拉流服务来做这个,DownloadService 开一个 Serivice 的方式会更稳定,并且不受其他影响

from gsyvideoplayer.

AlceZhang avatar AlceZhang commented on July 4, 2024

了解,学习了,谢谢您这几日及时的反馈与耐心的解答,受益匪浅。

from gsyvideoplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.