//依赖
implementation 'com.shuyu:GSYVideoPlayer:7.1.6'
//design配合视频使用
implementation 'com.google.android.material:material:1.1.0'
//需设置当前项目build.gradle
compileSdkVersion 30
buildToolsVersion "30.0.2"
minSdkVersion 24
targetSdkVersion 30
2.清单
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
//在application添加两个常用属性
<application
android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true"
/>
3.activity_player.xml可直接使用
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:minHeight="200dp"
>
<com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
android:id="@+id/player_player"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_collapseMode="parallax"
>
</com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal"
android:background="#35088693"
app:layout_collapseMode="pin"
>
<Button
android:id="@+id/player_btn_back"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:background="@null"
android:text="<"
android:textSize="30dp"
android:textColor="#ffffff"
/>
</LinearLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="match_parent"
android:layout_height="1000dp"
android:text="纺纱机回复萨芬撒空间哈佛撒看很快就萨芬"
android:textSize="50dp"
android:gravity="center"
/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
4.PlayerActivity
//初始化
private StandardGSYVideoPlayer _playerPlayer;
private Button _playerBtnBack;
private void assignViews() {
_playerPlayer = (StandardGSYVideoPlayer) findViewById(R.id.player_player);
_playerBtnBack = (Button) findViewById(R.id.player_btn_back);
}
//实现
assignViews();
_playerPlayer.setLooping(true);
_playerPlayer.setUp("https://txmov2.a.yximgs.com/upic/2020/11/20/18/BMjAyMDExMjAxODQ2MDRfNzc1MDY1NzVfMzk1MjA4MDgzNTJfMV8z_b_B0a59fa9bf8d09647ac718964c969a83a.mp4",true,"");
_playerPlayer.startPlayLogic();
//事故
//点击关闭当前页面
_playerBtnBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//_playerPlayer.
_playerPlayer.getCurrentPlayer().release();
finish();
}
});
//推荐
//网址https://blog.csdn.net/a550508153/article/details/80192100
// https://blog.csdn.net/wyh_File/article/details/80630700
文章浏览阅读2.2k次。Centos7 rsync守护进程上传文件失败[root@nfs ~]# rsync -avz /etc [email protected]::backupsending incremental file listrsync: read error: Connection reset by peer (104)rsync error: error in socket IO ..._rsync: read error: connection reset by peer (104) rsync error: error in sock
文章浏览阅读73次。题目链接:传送门#include<cstdio>#include<cstring>#include<algorithm>using namespace std;const int N = 200010;int n, mis, dp[N];int main() { while(scanf("%d", &n) != EOF) { //初始化 memset(dp, 0, sizeof(dp)); //初始化防御系统数量 int ans
文章浏览阅读92次。无_sass the rendersync() method is only available in node.js.
文章浏览阅读2.1k次。1、全局安装vue-cli$ npm install -global vue-cli2、创建一个基于 webpack 模板的新项目$ vue init webpack 项目名3、按照提示一步步操作,如下图:4、手动安装ajv$ npm install ajv@^6.0.0 ..._vue+element ui项目npm run dev
文章浏览阅读1.5k次。博客作者:凌逆战 博客地址:https://www.cnblogs.com/LXP-Never/p/12774058.html 文章代码:https://github.com/LXP-Never/blog_data/tree/master/tensorflow_model 我一直觉得TensorFlow的深度神经网络代码非常困难且繁琐,对Te..._tensorflow建立神经网络的框架
文章浏览阅读807次。方法一 使用Gif三方库加载1, 在moudle的build.gradle文件的dependencies节点下加上下面这句代码implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.16'三方库的依赖2, 静态加载: 在布局文件中引用三方库的GifImageView静态加载如下所示android:id="@+id/gif_v..._android 三方库 gifdrawable drawable = new gifdrawable 示例
文章浏览阅读1.2k次。递归读取 文件夹所有图片需要在相对路径"./image"文件夹中放入图片import osimport cv2 as cvdef find_image_file(source_path, file_lst): """ 递归寻找 文件夹以及子目录的 图片文件。 :param source_path: 源文件夹路径 :param file_lst: 输出 文件路径列表 :return: """ image_ext = ['.jpg', '.JP_根据图片路径得到在文件夹里的索引值
文章浏览阅读375次。本题目要求计算下列分段函数f(x)的值:输入格式:输入在一行中给出实数x。输出格式:在一行中按“f(x) = result”的格式输出,其中x与result都保留一位小数。输入样例1:10输出样例1:f(10.0) = 0.1输入样例2:0输出样例2:f(0.0) = 0.0代码:import java.util.Scanner;public class Main { public static void main(S._7-3 计算分段函数[1]
文章浏览阅读928次,点赞3次,收藏7次。为了更好的学习scrapy库,我决定先其前驱内容lxml库此次我们爬取豆瓣电影Top250代码如下:import requests from lxml import etreeimport timeimport csvheaders={ 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/53..._importrequestsfromlxmlimportetree headers={"user-agent":"mozilla/5.0 (wi
文章浏览阅读1.6k次。1.为什么要使用promise/*需求:异步的按顺序去读取1.txt、2.txt、3.txt文件的内容假设 1.txt内容为111 、2.txt内容为222、3.txt内容为333*/var fs = require('fs');、 fs.readFile('./files/1.txt','utf8',function(err,data){ if(err){ ..._nodejs new promise
文章浏览阅读740次。开发工具(eclipse/idea/vscode等):数据库(sqlite/mysql/sqlserver等):功能模块(请用文字描述,至少200字):_基于ssm框架的妙橙水果屋的设计与实现
文章浏览阅读1.5k次,点赞2次,收藏2次。boost::function的用法本片文章主要介绍boost::function的用法。 boost::function 就是一个函数的包装器(function wrapper),用来定义函数对象。1. 介绍 Boost.Function 库包含了一个类族的函数对象的包装。它的概念很像广义上的回调函数。其有着和函数指针相同的特性但是又包含了一个调用的接口。一个_boost::function0 function1