当前位置: 首页>>代码示例>>Java>>正文


Java DanmakuContext.create方法代码示例

本文整理汇总了Java中master.flame.danmaku.danmaku.model.android.DanmakuContext.create方法的典型用法代码示例。如果您正苦于以下问题:Java DanmakuContext.create方法的具体用法?Java DanmakuContext.create怎么用?Java DanmakuContext.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在master.flame.danmaku.danmaku.model.android.DanmakuContext的用法示例。


在下文中一共展示了DanmakuContext.create方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initDanmuConfig

import master.flame.danmaku.danmaku.model.android.DanmakuContext; //导入方法依赖的package包/类
/**
 * 初始化配置
 */
private void initDanmuConfig() {
    // 设置最大显示行数
    HashMap<Integer, Integer> maxLinesPair = new HashMap<Integer, Integer>();
    maxLinesPair.put(BaseDanmaku.TYPE_SCROLL_RL, 5); // 滚动弹幕最大显示5行
    // 设置是否禁止重叠
    HashMap<Integer, Boolean> overlappingEnablePair = new HashMap<Integer, Boolean>();
    overlappingEnablePair.put(BaseDanmaku.TYPE_SCROLL_RL, true);
    overlappingEnablePair.put(BaseDanmaku.TYPE_FIX_TOP, true);

    mDanmakuContext = DanmakuContext.create();
    mDanmakuContext
            .setDanmakuStyle(IDisplayer.DANMAKU_STYLE_NONE)
            .setDuplicateMergingEnabled(false)
            .setScrollSpeedFactor(1.2f)//越大速度越慢
            .setScaleTextSize(1.2f)
            .setCacheStuffer(new BackgroundCacheStuffer(), mCacheStufferAdapter)
            .setMaximumLines(maxLinesPair)
            .preventOverlapping(overlappingEnablePair);
}
 
开发者ID:mygu,项目名称:react-native-danmaku,代码行数:23,代码来源:DanmakuController.java

示例2: initDanmaku

import master.flame.danmaku.danmaku.model.android.DanmakuContext; //导入方法依赖的package包/类
private void initDanmaku() {
        // 设置最大显示行数
        HashMap<Integer, Integer> maxLinesPair = new HashMap<Integer, Integer>();
        // 滚动弹幕最大显示3行
        maxLinesPair.put(BaseDanmaku.TYPE_SCROLL_RL, 5);
        // 设置是否禁止重叠
        HashMap<Integer, Boolean> overlappingEnablePair = new HashMap<Integer, Boolean>();
        overlappingEnablePair.put(BaseDanmaku.TYPE_SCROLL_RL, true);
        overlappingEnablePair.put(BaseDanmaku.TYPE_FIX_TOP, true);

        mDanmakuContext = DanmakuContext.create();
        mDanmakuContext.setDanmakuStyle(IDisplayer.DANMAKU_STYLE_STROKEN, 3)
                .setDuplicateMergingEnabled(false)
                .setScrollSpeedFactor(1.2f)
                .setScaleTextSize(1.2f)
                .setCacheStuffer(new SpannedCacheStuffer(), null) // 图文混排使用SpannedCacheStuffer
//        .setCacheStuffer(new BackgroundCacheStuffer())  // 绘制背景使用BackgroundCacheStuffer
                .setMaximumLines(maxLinesPair)
                .preventOverlapping(overlappingEnablePair);
    }
 
开发者ID:succlz123,项目名称:BlueBoard,代码行数:21,代码来源:VideoPlayActivity.java

示例3: initMediaPlayer

import master.flame.danmaku.danmaku.model.android.DanmakuContext; //导入方法依赖的package包/类
@SuppressLint("UseSparseArrays")
private void initMediaPlayer() {
  //配置播放器
  MediaController mMediaController = new MediaController(this);
  mMediaController.setTitle(title);
  mPlayerView.setMediaController(mMediaController);
  mPlayerView.setMediaBufferingIndicator(mBufferingIndicator);
  mPlayerView.requestFocus();
  mPlayerView.setOnInfoListener(onInfoListener);
  mPlayerView.setOnSeekCompleteListener(onSeekCompleteListener);
  mPlayerView.setOnCompletionListener(onCompletionListener);
  mPlayerView.setOnControllerEventsListener(onControllerEventsListener);
  //设置弹幕开关监听
  mMediaController.setDanmakuSwitchListener(this);
  //设置返回键监听
  mMediaController.setVideoBackEvent(this);

  //配置弹幕库
  mDanmakuView.enableDanmakuDrawingCache(true);
  //设置最大显示行数
  HashMap<Integer, Integer> maxLinesPair = new HashMap<>();
  //滚动弹幕最大显示5行
  maxLinesPair.put(BaseDanmaku.TYPE_SCROLL_RL, 5);
  //设置是否禁止重叠
  HashMap<Integer, Boolean> overlappingEnablePair = new HashMap<>();
  overlappingEnablePair.put(BaseDanmaku.TYPE_SCROLL_RL, true);
  overlappingEnablePair.put(BaseDanmaku.TYPE_FIX_TOP, true);
  //设置弹幕样式
  danmakuContext = DanmakuContext.create();
  danmakuContext.setDanmakuStyle(IDisplayer.DANMAKU_STYLE_STROKEN, 3)
      .setDuplicateMergingEnabled(false)
      .setScrollSpeedFactor(1.2f)
      .setScaleTextSize(0.8f)
      .setMaximumLines(maxLinesPair)
      .preventOverlapping(overlappingEnablePair);

  loadData();
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:39,代码来源:VideoPlayerActivity.java

示例4: initMediaPlayer

import master.flame.danmaku.danmaku.model.android.DanmakuContext; //导入方法依赖的package包/类
private void initMediaPlayer() {
    MediaController controller = new MediaController(this);
    controller.setTitle(mTitle);
    mPlayerView.setMediaController(controller);
    mPlayerView.setMediaBufferingIndicator(mBufferingIndicator);
    mPlayerView.requestFocus();
    mPlayerView.setOnInfoListener(mOnInfoListener);
    mPlayerView.setOnSeekCompleteListener(mOnSeekCompleteListener);
    mPlayerView.setOnCompletionListener(mOnCompletionListener);
    mPlayerView.setOnControlEventsListener(mOnControlEventsListener);
    // 设置弹幕开关监听
    controller.setDanmakuSwitchListener(this);
    // 设置返回键监听
    controller.setVideoBackListener(this);
    // 配置弹幕库
    mDanmakuView.enableDanmakuDrawingCache(true);
    // 设置最大显示行数
    HashMap<Integer, Integer> maxLinesPair = new HashMap<>();
    // 滚动屏幕最大显示五行
    maxLinesPair.put(BaseDanmaku.TYPE_SCROLL_RL, 5);
    // 设置是否禁止重叠
    HashMap<Integer, Boolean> overlappingEnablePair = new HashMap<>();
    overlappingEnablePair.put(BaseDanmaku.TYPE_SCROLL_RL, true);
    overlappingEnablePair.put(BaseDanmaku.TYPE_FIX_TOP, true);
    // 设置弹幕样式
    mDanmakuContext = DanmakuContext.create();
    mDanmakuContext.setDanmakuStyle(IDisplayer.DANMAKU_STYLE_STROKEN, 3)
            .setDuplicateMergingEnabled(false)
            .setScrollSpeedFactor(1.2f)
            .setScaleTextSize(0.8f)
            .setMaximumLines(maxLinesPair)
            .preventOverlapping(overlappingEnablePair);
    loadData();
}
 
开发者ID:MUFCRyan,项目名称:BilibiliClient,代码行数:35,代码来源:VideoPlayerActivity.java

示例5: initUi

import master.flame.danmaku.danmaku.model.android.DanmakuContext; //导入方法依赖的package包/类
@Override
protected void initUi() {
    updateVideoLayoutParams();
    mVideoPlayView.setBufferingIndicator(mProgressBar);
    mDanmakuView.enableDanmakuDrawingCache(true);
    mDanmakuContext = DanmakuContext.create();
    mDanmakuContext.setDuplicateMergingEnabled(true);
    mDanmakuView.prepare(parser, mDanmakuContext);
    if (!isLandscape()) {
        mDanmakuView.hideAndPauseDrawTask();
        isShowDanmu = false;
    }
}
 
开发者ID:yinyiliang,项目名称:RabbitCloud,代码行数:14,代码来源:LiveRoomActivity.java

示例6: startDamaku

import master.flame.danmaku.danmaku.model.android.DanmakuContext; //导入方法依赖的package包/类
/**
     * 初始化弹幕
     */
    public void startDamaku(Uri uri) {
        // 设置最大显示行数
        HashMap<Integer, Integer> maxLinesPair = new HashMap<>();
        maxLinesPair.put(BaseDanmaku.TYPE_SCROLL_RL, 5); // 滚动弹幕最大显示3行
        // 设置是否禁止重叠
        HashMap<Integer, Boolean> overlappingEnablePair = new HashMap<>();
        overlappingEnablePair.put(BaseDanmaku.TYPE_SCROLL_RL, true);
        overlappingEnablePair.put(BaseDanmaku.TYPE_FIX_TOP, true);

        danmakuContext = DanmakuContext.create();
        danmakuContext.setDanmakuStyle(IDisplayer.DANMAKU_STYLE_STROKEN, 3).setDuplicateMergingEnabled(false).setScrollSpeedFactor(1.2f).setScaleTextSize(1.2f)
                .setCacheStuffer(new SpannedCacheStuffer()) // 图文混排使用SpannedCacheStuffer
//        .setCacheStuffer(new BackgroundCacheStuffer())  // 绘制背景使用BackgroundCacheStuffer
                .setMaximumLines(maxLinesPair)
                .preventOverlapping(overlappingEnablePair);
        if (mDanmaku != null) {
            //设置弹幕地址
            if(uri == null){
                return;
            }
            String url = uri.toString();
            mParser = createParser(url);
            //弹幕开始监听
            mDanmaku.setCallback(new MyLoadDanmakuListener());
            mDanmaku.prepare(mParser, danmakuContext);
            mDanmaku.showFPS(true);
            mDanmaku.enableDanmakuDrawingCache(true);
        }
    }
 
开发者ID:liucloo,项目名称:ijkPlayer-Danmaku,代码行数:33,代码来源:Damaku.java

示例7: initDanmuConfig

import master.flame.danmaku.danmaku.model.android.DanmakuContext; //导入方法依赖的package包/类
private void initDanmuConfig() {
    // 设置最大显示行数
    HashMap<Integer, Integer> maxLinesPair = new HashMap<>();
    maxLinesPair.put(BaseDanmaku.TYPE_SCROLL_RL, 4); // 滚动弹幕最大显示4行
    // 设置是否禁止重叠
    HashMap<Integer, Boolean> overlappingEnablePair = new HashMap<>();
    overlappingEnablePair.put(BaseDanmaku.TYPE_SCROLL_RL, true);
    overlappingEnablePair.put(BaseDanmaku.TYPE_FIX_TOP, true);

    mDanmakuContext = DanmakuContext.create();
    mDanmakuContext.setDanmakuStyle(IDisplayer.DANMAKU_STYLE_NONE)
            .setDuplicateMergingEnabled(false)
            .setScrollSpeedFactor(1.2f)//越大速度越慢
            .setScaleTextSize(1.2f)
            .setMaximumLines(maxLinesPair)
            .preventOverlapping(overlappingEnablePair);

    setCallback(new DrawHandler.Callback() {
        @Override
        public void prepared() {
            start();
        }

        @Override
        public void updateTimer(DanmakuTimer timer) {

        }

        @Override
        public void danmakuShown(BaseDanmaku danmaku) {

        }

        @Override
        public void drawingFinished() {

        }
    });

    prepare(new BaseDanmakuParser() {
        @Override
        protected IDanmakus parse() {
            return new Danmakus();
        }
    }, mDanmakuContext);

    enableDanmakuDrawingCache(true);
}
 
开发者ID:ayaseruri,项目名称:luxunPro,代码行数:49,代码来源:DanmakuView.java


注:本文中的master.flame.danmaku.danmaku.model.android.DanmakuContext.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。