转自:https://idig8.com/2018/09/22/xiaochengxujavashizhanxiaochengxushipinzhanshiyekaifa51/

这次说下,小程序的视频组件,图标放置 关联到了之前没有说过的一个组件cover-view。https://github.com/limingios/wxProgram.git 中No.15

覆盖在原生组件之上的文本视图

  • 官网介绍
    >https://developers.weixin.qq.com/miniprogram/dev/component/cover-view.html

视频上需要添加功能


Page({ data: {
cover:'cover',
}
})
<view style='width:100%;height:100%'>
<video src="https://127.0.0.1:8081/180831CF2TS25MNC/4e0ca373-6520-45b9-a1a6-7ee8429dc5d8.mp4" muted='{{true}}' controls='{{false}}' autoplay='{{true}}' loop='{{true}}' enable-progress-gesture='{{false}}'
style='width:100%;height:100%;'
objectFit='{{cover}}'
> <cover-view class='container'>
<!-- 上传视频 --> <cover-image src='../../resource/images/camera.png' style='width:50rpx;height:50rpx;' bindtap='upload'></cover-image> <!-- 搜索按钮 -->
<cover-image src='../../resource/images/search.png' style='width:45rpx;height:45rpx;' bindtap='showSearch'></cover-image> </cover-view> <cover-view class='container-me'>
<!-- 头像 -->
<cover-image class="face" src='{{serverUrl}}{{publisher.faceImage}}' bindtap='showPublisher'></cover-image> <!-- 喜欢收藏按钮 -->
<block wx:if="{{userLikeVideo}}">
<cover-image class="size-me" src='../../resource/images/like.png' style='margin-top:30rpx;' bindtap='likeVideoOrNot'></cover-image>
</block>
<block wx:else>
<cover-image class="size-me" src='../../resource/images/unlike.png' style='margin-top:30rpx;' bindtap='likeVideoOrNot'></cover-image>
</block> <!-- 评论按钮 -->
<cover-image class="size-me" src='../../resource/images/comments.png' style='margin-top:30rpx;' bindtap='leaveComment'></cover-image> <!-- 分享按钮 -->
<cover-image class="size-me" src='../../resource/images/share.png' style='margin-top:30rpx;' bindtap='shareMe'></cover-image> </cover-view> <cover-view class='container-words'> <cover-view>@{{publisher.nickname}}</cover-view> <cover-view class='video-desc'>{{videoInfo.videoDesc}}</cover-view> </cover-view> <cover-view class='container-bottom'>
<!-- 首页按钮 -->
<cover-image class='' src='../../resource/images/index.png' class="size-bottom" bindtap='showIndex'></cover-image> <!-- 我的按钮 -->
<cover-image class='' src='../../resource/images/mine.png' class="size-bottom" bindtap='showMine'></cover-image> </cover-view>
</video>
</view>
page {
height: 100%;
background-color: #141414;
} .container {
display: flex;
margin-top: 20rpx;
margin-left: 50rpx;
margin-right: 50rpx;
justify-content: space-between;
} .container-me {
margin-top: 360rpx;
margin-left: 50rpx;
width: 80rpx;
} .container-words {
/* display: flex;
flex-direction: column; */
margin-top: 60rpx;
margin-left: 50rpx;
width: 100%;
color: white;
font-size: 14px;
} .inputText {
background-color: gainsboro;
height: 35px;
} .video-desc {
width: 600rpx;
height: 100rpx;
white-space: pre-wrap;
} .container-bottom {
/* bottom: 10px; */
display: flex;
margin-top: 60rpx;
margin-left: 50rpx;
margin-right: 50rpx;
/* margin-bottom: 10rpx; */
justify-content: space-between;
/* position: fixed; */
} .size-me {
width: 70rpx;
height: 70rpx;
} .size-me-bgm {
width: 40rpx;
height: 40rpx;
} .bgm-style {
display: flex;
flex-direction: row;
} .size-bottom {
width: 60rpx;
height: 60rpx;
} .face2 {
width: 75rpx;
height: 75rpx;
border: 0 solid #f00;
border-radius: 100rpx;
background-color: #f10b2e;
} .face {
width: 75rpx;
height: 75rpx;
/* margin: 20rpx; */
border-radius: 50%;
} .icoBtn {
flex: 1;
width: 80rpx;
height: 100%;
} .comments-scoll {
height: 1200rpx;
} .comments-all {
/* margin-top: 10px; */
margin-bottom: 10px;
/* border-bottom: solid 1px gray; */
background-color: #141414;
color: #e8e8e8;
} .face-comments {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
margin-left: 5px;
} .container-comments{
display: flex; /* margin-top: 20rpx;
margin-left: 50rpx;
margin-right: 50rpx;
justify-content: space-between; */ } .nickname-comments {
margin-left: 10px;
} .nickname-lbl{
color: #a1a1a1;
} .date-lbl{
color: #a1a1a1;
} .comments-content{
margin-left: 5px;
margin-right: 5px;
/* margin-bottom: 10px; */
border-bottom: solid 1px #232323;
background-color: #141414;
} .saySthView {
padding: 10px;
background-color: #141414;
line-height: 45px;
border-bottom: solid 1px #232323;
color: white;
} .saySth {
margin-top: 10px;
margin-left: 10px;
font-size: 18px;
}

PS:如果我们把cover-view中的cover去掉的话,我们这个view肯定是无法保存在我们的视频里面的。下面的我们来一起实现里面的功能。

「小程序JAVA实战」小程序视频展示页开发(52)的更多相关文章

  1. 「小程序JAVA实战」小程序视频封面处理(48)

    转自:https://idig8.com/2018/09/16/xiaochengxujavashizhanxiaochengxushipinfengmianchuli47/ 截图这块,在微信小程序工 ...

  2. 「小程序JAVA实战」小程序的flex布局(22)

    转自:https://idig8.com/2018/08/09/xiaochengxu-chuji-22/ 之前已经把小程序的框架说完了,接下来说说小程序的组件,在说组件之前,先说说布局吧.源码:ht ...

  3. 「小程序JAVA实战」小程序的留言和评价功能(70)

    转自:https://idig8.com/2018/10/28/xiaochengxujavashizhanxiaochengxudeliuyanhepingjiagongneng69/ 目前小程序这 ...

  4. 「小程序JAVA实战」小程序的举报功能开发(68)

    转自:https://idig8.com/2018/09/25/xiaochengxujavashizhanxiaochengxudeweixinapicaidancaozuo66-2/ 通过点击举报 ...

  5. 「小程序JAVA实战」小程序的个人信息作品,收藏,关注(66)

    转自:https://idig8.com/2018/09/24/xiaochengxujavashizhanxiaochengxudegerenxinxizuopinshoucangguanzhu65 ...

  6. 「小程序JAVA实战」小程序的关注功能(65)

    转自:https://idig8.com/2018/09/24/xiaochengxujavashizhanxiaochengxudeguanzhugongneng64/ 在个人页面,根据发布者个人和 ...

  7. 「小程序JAVA实战」小程序的视频点赞功能开发(62)

    转自:https://idig8.com/2018/09/24/xiaochengxujavashizhanxiaochengxudeshipindianzangongnengkaifa61/ 视频点 ...

  8. 「小程序JAVA实战」小程序的springboot后台拦截器(61)

    转自:https://idig8.com/2018/09/24/xiaochengxujavashizhanxiaochengxudespringboothoutailanjieqi60/ 之前咱们把 ...

  9. 「小程序JAVA实战」小程序首页视频(49)

    转自:https://idig8.com/2018/09/21/xiaochengxujavashizhanxiaochengxushouyeshipin48/ 视频显示的内容是视频的截图,用户的头像 ...

  10. 「小程序JAVA实战」小程序上传短视频(46)

    转自:https://idig8.com/2018/09/14/xiaochengxujavashizhanxiaochengxushangchuanduanshipin45/ 个人信息:用户上传短视 ...

随机推荐

  1. PrestaShop 1.7 用户用户结账的时候出现承运人错误

    出现承运人的错误:Unfortunately, there are no carriers available for your delivery address. 如何解决这个错误? 请参考下面的解 ...

  2. asp.net 导入Excel记录到数据库中

    常用到的一个数据库导入功能,这样的话就省了很大一部分时间来处理程序上的问题而不是无休止的重复复制粘贴动作. 其他的废话不多说,直接上代码: 前提条件: 根目录下建立uploadfiles文件夹(用于保 ...

  3. 关于oceanbase中存储过程的设计与实现

    转自http://www.zhujuncoding.com/index.php/Index/blogview?id=82 这篇文章是关于在淘宝的数据库oceanbase中添加存储过程支持的文章,oce ...

  4. Win7系统Visual Studio 2013配置OpenCV3.1图文详解

    Win7系统Visual Studio 2013配置OpenCV3.1图文详解 OpenCV3.1对硬件加速和移动开发的支持相对于老版本都有了较大改进,支持新的开发工具,更易于扩展,配置方式也比以前简 ...

  5. SVN的 安装

    关于svn的安装,如图分别是服务端和客户端 下载地址:http://subversion.apache.org/packages.html 1.双击VisualSVN,点下一步,选择目录,就可以,很简 ...

  6. scikit-learn 学习笔记-- Generalized Linear Models (二)

    Lasso regression 今天介绍另外一种带正则项的线性回归, ridge regression 的正则项是二范数,还有另外一种是一范数的,也就是lasso 回归,lasso 回归的正则项是系 ...

  7. 项目代码matlab

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ...

  8. Linux wget auto login and backup database

    #!/bin/bash # 这是一份本来打算采用自动备份数据的代码,由于测试过程中出现了无法连接的问题,导致不能测试, # 于是最后放弃了这份代码的进一步的开发,但是记录还是有必要的 login_ur ...

  9. 【java多线程】java的线程池分析

    (一)线程池的拒绝策略 --->拒绝策略的接口java.util.concurrent.RejectedExecutionHandler --->终止策略(默认):java.util.co ...

  10. asp.net(C#)链接Oracle连接字符串

    在NET环境中链接Oracle数据库有两种组建链接方式: 1)使用OleDB组件是通过Oracle OleDB驱动程序(OraOLEDB.dll)连接和访问Oracle数据库2)使用System.Da ...