Git Product home page Git Product logo

Comments (11)

DidoFitch avatar DidoFitch commented on July 16, 2024

requestFullScreen事件监听不到全屏事件

from h5demo.

alilmq avatar alilmq commented on July 16, 2024
  1. 可以设置aliplayer的playsinline:true,同时 WebView 需要设置 allowsInlineMediaPlayback,这样页面在 App 里打开时视频就能以非全屏模式(即内联的方式)播放了
  2. 这个是在iOS下面的一个bug, 新版本会修复

from h5demo.

DidoFitch avatar DidoFitch commented on July 16, 2024

回复:问题1已解决,但是新的问题出现了,我发现在IOS下seek()方法无效了,无法跳转到指定时间开始播放。
详细情况:IOS 7.1.2,
拟实现功能:自动记录播放进度,下次进入页面时续播。
目前情况:可以正常记录进度,调试通过,但seek()后仍然从头开始播放,seek()方法写在播放器创建完成后的回调内的

from h5demo.

DidoFitch avatar DidoFitch commented on July 16, 2024

对于requestFullScreen的问题,在IOS下主动点击全屏按钮是可以监听的,这个是我描述不够清楚,具体是因为我没设置内联播放,所以IOS自动全屏的这个事件用requestFullScreen监听不到,这应该不算BUG...

from h5demo.

alilmq avatar alilmq commented on July 16, 2024

把seek事件写在play事件里试一下

from h5demo.

DidoFitch avatar DidoFitch commented on July 16, 2024

仍然无效的
player.on("play",function(e){ //开始播放时要做的 vue_obj.CurrentTime = getDB("video_"+vue_obj.section.id) || 0;//获取本地记录的本课程视频学习时间 if(vue_obj.CurrentTime > 0){ //如果记录有播放时间,则接着播放 console.log(vue_obj.CurrentTime); //这里输出时间正常 player.seek(vue_obj.CurrentTime);//跳转到记录的时间开始播放 } if(vue_obj.CurrentTime > 0 && !can_pause){ mui.toast("已为您跳转到上次记录的时间"); } getTime(); var t2 = setTimeout(function(){ can_pause = true; },1000*2) });
而且我尝试seek一个定值,也无效

from h5demo.

alilmq avatar alilmq commented on July 16, 2024

你可以试一下原生的seek方法可不可以的, 是不是平台本身的限制, $(that.player.el()).find('video')[0].currentTime =10, 也可以在canplay事件里尝试一下, 这个事件会多次触发,需要判断一下是不是第一次触发

from h5demo.

DidoFitch avatar DidoFitch commented on July 16, 2024

我尝试下吧,也麻烦您有空测试下IOS下的seek
另外文档里好像没有canplay事件?

from h5demo.

alilmq avatar alilmq commented on July 16, 2024

嗯,canplay是原生播放器本身的事件,可以尝试一下, 进度条的拖动就是通过seek实现的,如果可以拖动,方法本身应该是没问题的, 其实你这种case是不是应该在new Aliplayer的回调方法里, 通过loadByUrl方法加载地址播放,这个方法的第二个参数可以传开始播放的时间

from h5demo.

DidoFitch avatar DidoFitch commented on July 16, 2024

项目采用的VideoID+PlayAuth的方案,而且不允许拖动。
但是IOS端全屏后像是被IOS自带视频播放器拦截了,仍然可以拖动,全屏后的UI也是IOS的

from h5demo.

alilmq avatar alilmq commented on July 16, 2024

iOS端全屏调用的是video的全屏方法, 这样全屏后可以旋转

from h5demo.

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.