All Projects → xujiaji → Dmview2

xujiaji / Dmview2

Licence: apache-2.0
轻量级弹幕,三步即可展示弹幕;也可作为公告的动态展示用途

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Dmview2

danmu-classroom-screen
danmu-classroom-screen
Stars: ✭ 18 (-74.29%)
Mutual labels:  danmu
Danmu.fm
douyutv danmu 斗鱼TV 弹幕助手
Stars: ✭ 315 (+350%)
Mutual labels:  danmu
Danmu
Python 弹幕包 A live danmu package for python
Stars: ✭ 661 (+844.29%)
Mutual labels:  danmu
acfundanmu
AcFun直播API
Stars: ✭ 27 (-61.43%)
Mutual labels:  danmu
Ocbarrage
iOS 弹幕库 OCBarrage, 同时渲染5000条弹幕也不卡, 轻量, 可拓展, 高度自定义动画, 超高性能, 简单易上手; A barrage render-engine with high performance for iOS. At the same time, rendering 5000 barrages is also very smooth, lightweight, scalable, highly custom animation, ultra high performance, simple and easy to use!
Stars: ✭ 294 (+320%)
Mutual labels:  danmu
Danmaku
A high-performance JavaScript danmaku engine. 高性能弹幕引擎库
Stars: ✭ 446 (+537.14%)
Mutual labels:  danmu
Weiya
尾牙小程序
Stars: ✭ 207 (+195.71%)
Mutual labels:  danmu
Danmu.go
基于golang的命令行形式的直播网站(斗鱼)的弹幕浏览
Stars: ✭ 14 (-80%)
Mutual labels:  danmu
Kikoplay
KikoPlay - NOT ONLY A Full-Featured Danmu Player 不仅仅是全功能弹幕播放器
Stars: ✭ 313 (+347.14%)
Mutual labels:  danmu
Video Live
视频直播
Stars: ✭ 635 (+807.14%)
Mutual labels:  danmu
ksdanmu
快手直播弹幕
Stars: ✭ 18 (-74.29%)
Mutual labels:  danmu
DouyuDanmu
抓取斗鱼弹幕,并支持自动发送弹幕 Collect DanMu from Douyu TV
Stars: ✭ 29 (-58.57%)
Mutual labels:  danmu
Artplayer
🎨 ArtPlayer.js is a modern and full featured HTML5 video player
Stars: ✭ 484 (+591.43%)
Mutual labels:  danmu
DouyuBarrage-Pro
(2020年最新)斗鱼弹幕抓取及可视化管理平台第二版,提供弹幕抓取、弹幕实时发送速度可视化、抓取记录查询、弹幕下载、自定义关键词统计、铁粉统计、高光时刻自动捕获、高频弹幕词云等功能,起飞~~~
Stars: ✭ 139 (+98.57%)
Mutual labels:  danmu
Bulletjs
👨‍💻‍一个原生js弹幕库
Stars: ✭ 22 (-68.57%)
Mutual labels:  danmu
Real Url
获取斗鱼&虎牙&哔哩哔哩&抖音&快手等 58 个直播平台的真实流媒体地址(直播源)和弹幕,直播源可在 PotPlayer、flv.js 等播放器中播放。
Stars: ✭ 3,748 (+5254.29%)
Mutual labels:  danmu
Rc Bullets
🌈基于CSS3 Animation,使用React构建的弹幕组件
Stars: ✭ 391 (+458.57%)
Mutual labels:  danmu
Xcdanmuview
Android弹幕效果View-支持左右两个方向
Stars: ✭ 28 (-60%)
Mutual labels:  danmu
Abplayerhtml5
Video Player for danmaku comments. ABPlayer in HTML5. ABPlayer核心构件以动态HTML编写的版本。向HTML5进发!HTML5弹幕播放器
Stars: ✭ 858 (+1125.71%)
Mutual labels:  danmu
Ocbarrage
iOS 弹幕库 OCBarrage, 同时渲染5000条弹幕也不卡, 轻量, 可拓展, 高度自定义动画, 超高性能, 简单易上手; A barrage render-engine with high performance for iOS. At the same time, rendering 5000 barrages is also very smooth, lightweight, scalable, highly custom animation, ultra high performance, simple and easy to use!
Stars: ✭ 589 (+741.43%)
Mutual labels:  danmu

DMView2

GitHub release

建议下载主分支类库dmlib2导入项目,由于项目目前并不稳定,并伴随经常修改,短时间不会继续发布远程仓库版本

介绍

该项目是为了弃用DMView,因为当时刚刚进入实习用RecyclerView动画实现的,性能很差。后来我离职后又再也没管了,不过有很多朋友又使用了DMView,本着写出来就要负责的态度,于是写了这个续集。

  1. DMView2不是单纯的只有文字的弹幕,可图文一起;
  2. DMView2目前通过两种方式实现,SurfaceViewTextureView。大家在使用的时候可以自行选择;
  3. DMView2只是展示您设置好的View模板,模板可通过写xml布局,并且可以同时添加多种模板;
  4. 如果是视频弹幕的话那么建议用bilibili开源的弹幕更好点;
  5. 本库适合轻量级弹幕,弹幕样式高度自定义(你可以理解为该框架就是个展示传输带,你把要展示的图片扔上去就行了)
  6. 该类库还可以用来展示动态的公告消息

测试效果演示

测试Gif展示

方法参照表

xml参数 作用
dm_direction right_leftleft_right
up_downdown_up
down_up:弹幕从下往上跑;
up_down:弹幕从上往下跑;
left_right:弹幕从左往右跑;
right_left:弹幕从右往左跑
dm_span dp 刷新一次界面弹幕所移动的跨度
dm_span_time int 每个跨度需要的时间,单位:ms(毫秒)
dm_sleep int 每次刷新需要睡眠多久,单位:ms(毫秒)
dm_v_space dp 弹幕之间的垂直方向间距
dm_h_space dp 弹幕之间的横向间距

注意: dm_spandm_sleep可配合使用,调整弹幕运动速度

添加依赖

build.gradle文件中添加依赖

implementation 'com.github.xujiaji:dmlib2:0.0.6'

如何使用?

步骤一

在布局xml文件中添加(或使用DMSurfaceView):

    <com.xujiaji.dmlib2.widget.DMTextureView
        android:id="@+id/dmView"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        app:dm_direction="right_left"
        app:dm_span="2dp"
        app:dm_v_space="8dp"
        app:dm_h_space="16dp"
        app:dm_span_time="16" />

步骤二

创建弹幕模板布局,可参考

barrage.xml
announcement_image_text.xml
barrage_down_up.xml

步骤三

获取DMSurfaceView实例,通过add方法添加弹幕,弹幕为步骤2设置好数据的模板。

View view = LayoutInflater.from(this).inflate(R.layout.announcement_text, null);
mDMSurfaceView.getController().add(view);

或者子线程中添加

dmSurfaceView.getController().add(new ViewCreator() {
    @Override
    public View build() {
        return LayoutInflater.from(MainActivity.this).inflate(R.layout.barrage_other, null);
    }
});

注意:

最好在Activity或Fragment的onPause周期中调用下暂停,如下:

    @Override
    protected void onPause() {
        super.onPause();
        dmSurfaceView.getController().pause();
    }

该代码只展示了DMSurfaceView,查看DMTexutureView使用请参考 TestTextureActivity.java

更新

License

   Copyright 2018 XuJiaji

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].