纯iyu实现滑动触屏快进快退播放视频

不多说 直接上代码 没啥亮点 主要就是判断手势
代码放在触屏监听事件:

f(st_eA == 0)
{
  ss x = st_rX
  ss y = st_rY
}
else f(st_eA == 1)
{
  ss xx1 = st_eX
  ss yy1 = st_eY
  s(ss.xx1 - ss.x,gesture)
  f(gesture> 100)
  {
   // 右滑手势
    ss(st_rX,rightx)
    ss(st_rY,righty)
    s(ss.x-rightx,xx)
    sn(xx+100,xxx)
    s(xxx*100,xxxx)
    s(xxxx/1000,Second)
    sr(Second,"-","",Seconds)
    us(17,"visibility","visible")
    ss(">>快进"+Seconds+"秒",Secondss)
    us(17,"text",Secondss)
    bfvss(16,"cn",Time)
    ss(Seconds+"000",Timea)
    s(Time+Timea,Seekto)
    bfvss(16,"seekto",Seekto)
    bfvss(16,"st")
  }
  s(ss.x - ss.xx1,gesture)
  f(gesture> 100)
  {
    //左滑手势
    ss(st_rX,xx)
    ss(st_rY,yy)
    s(ss.x-xx,xxx)
    sr(xxx,"-","",xxx)
    s(xxx*100,xxxx)
    s(xxxx/1000,Second)
    sr(Second,"-","",Second)
    us(17,"visibility","visible")
    ss("<<快退"+Second+"秒",Seconds) 
    us(17,"text",Seconds)
    bfvss(16,"cn",Time)
    ss(Second+"000",Timea)
    s(Time-Timea,Seekto)
    bfvss(16,"seekto",Seekto)
    bfvss(16,"st")
  }
  
}

利用ss.y和ss.yy1还可以判断上下滑动手势哦
发表评论 / Comment

用心评论~