帖子
帖子
用户
博客
课程
12下一页
返回列表 发新帖
显示全部楼层
61
帖子
0
勋章
280
Y币

[插件使用] moviePlayer 模块怎么样才能跟着页面滚动?

[复制链接]
发表于 2019-5-7 22:17:35
fixed:
  • 类型:布尔
  • 描述:(可选项)模块是否随所属 window 或 frame 滚动
  • 默认值:true(不随之滚动)

这个属性要怎么才能生效。有没有DEMO可以查看。

26
帖子
2
勋章
9404
Y币
fixedOn: api.frameName,
fixed: false,这样就行
61
帖子
0
勋章
280
Y币
代码:
  1. //打开视频
  2.     function fnOpenVideo() {
  3.         var moviePlayer = api.require('moviePlayer');
  4.         moviePlayer.open({
  5.             rect: {
  6.                 x: 0,
  7.                 y: 0,
  8.                 w: api.frameWidth,
  9.                 h: 274
  10.             },
  11.             styles: {
  12.                 head: {
  13.                     bg: 'rgba(0,0,0,0)',
  14.                     height: 30,
  15.                     y: api.safeArea.top,
  16.                     title: {
  17.                         size: 15,
  18.                         color: '#fff',
  19.                         width: 40,
  20.                         leftMargin: 10
  21.                     },
  22.                     backSize: 20,
  23.                     backImg: 'widget://image/back.png',
  24.                     customButtons: [{
  25.                         w: 30,
  26.                         h: 30,
  27.                         rightMagin: 10,
  28.                         img: 'widget://image/image/collect.png',
  29.                         imgSelected: 'fs://image/collectSelected.png',
  30.                     }]
  31.                 },
  32.                 foot: {
  33.                     bg: 'rgba(0,0,0,0.5)',
  34.                     height: 44,
  35.                     palyBtn: {
  36.                         size: 20,
  37.                         playImg: 'widget://image/play.png',
  38.                         pauseImg: 'widget://image/pause.png',
  39.                         marginLeft: 5
  40.                     },
  41.                     currentTimeLabel: {
  42.                         textSize: 14,
  43.                         textColor: "#FFF",
  44.                         textWidth: 43,
  45.                         marginLeft: 5
  46.                     },
  47.                     seekBar: {
  48.                         sliderImg: 'widget://image/circle.png',
  49.                         sliderW: 20,
  50.                         sliderH: 20,
  51.                         progressColor: '#696969',
  52.                         progressSelected: '#76EE00',
  53.                         marginLeft: 10,
  54.                         marginRight: 10
  55.                     },
  56.                     totalTimeLabel: {
  57.                         textSize: 14,
  58.                         textColor: "#FFF",
  59.                         textWidth: 43,
  60.                         marginRight: 5
  61.                     },
  62.                     fullscreenBtn: {
  63.                         size: 20,
  64.                         verticalImg: 'widget://image/vertical.png',
  65.                         horizontalImg: 'widget://image/horizontal.png',
  66.                     }
  67.                 }
  68.             },
  69.             texts: {
  70.                 title: '足球'
  71.             },
  72.             isShowStatusBar: true,
  73.             autorotation: false,
  74.             useGestureControl: false,
  75.             showBack: true,
  76.             coverImg: 'widget://temp/pic1.png',
  77.             path: 'http://**.**2.z0.glb**.**/c1.1.mp4',
  78.             autoPlay: false,
  79.             fixedOn: api.frameName,
  80.             fixed: false,
  81.         }, function(ret, err) {
  82.             if (ret) {
  83.                 // alert(JSON.stringify(ret));
  84.                 // } else {
  85.                 // alert(JSON.stringify(err));
  86.             }

  87.         });
  88.         moviePlayer.addEventListener(function(ret) {
  89.             console.log(JSON.stringify(ret))
  90.             if (ret && ret.eventType == 'back') {
  91.                 api.closeWin();
  92.             }
  93.         });
  94.     }
复制代码
90
帖子
2
勋章
2237
Y币
false就行了
73
帖子
0
勋章
328
Y币
false
42
帖子
4
勋章
1万+
Y币
false
37
帖子
2
勋章
3711
Y币
fixed: false
61
帖子
0
勋章
280
Y币
飞翔的翔 发表于 2019-5-7 22:40
fixedOn: api.frameName,
fixed: false,这样无效吗

无效哈,你看我写的那个代码,
61
帖子
0
勋章
280
Y币

看2楼我写的代码,就是false
175
帖子
1
勋章
5678
Y币
用的最新版本模块吗
12下一页
您需要登录后才可以回帖 登录

本版积分规则