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


Java IVLCVout.setSubtitlesView方法代码示例

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


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

示例1: VlcMediaPlayer

import org.videolan.libvlc.IVLCVout; //导入方法依赖的package包/类
public VlcMediaPlayer(SurfaceView videoView, SurfaceView subtitlesView, List<String> libVlcOptions) {
    super(createLibVlc(libVlcOptions));
    LibVLC.setOnNativeCrashListener(nativeCrashListener);

    setMaxPlayRate(64); // TODO pref
    setEventListener(vlcEventListener);

    // video output
    final IVLCVout vout = getVLCVout();
    vout.setVideoView(videoView);
    if (subtitlesView != null)
        vout.setSubtitlesView(subtitlesView);
    vout.addCallback(nativeCallback);
    vout.attachViews();
}
 
开发者ID:oakesville,项目名称:mythling,代码行数:16,代码来源:VlcMediaPlayer.java

示例2: startPlayback

import org.videolan.libvlc.IVLCVout; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void startPlayback() {
    /* start playback only when audio service and both surfaces are ready */
    if (mPlaybackStarted || mService == null)
        return;

    LibVLC().setOnHardwareAccelerationError(this);
    final IVLCVout vlcVout = mService.getVLCVout();
    if (mPresentation == null) {
        vlcVout.setVideoView(mSurfaceView);
        if (mSubtitlesSurfaceView.getVisibility() != View.GONE)
            vlcVout.setSubtitlesView(mSubtitlesSurfaceView);
    } else {
        vlcVout.setVideoView(mPresentation.mSurfaceView);
        if (mSubtitlesSurfaceView.getVisibility() != View.GONE)
            vlcVout.setSubtitlesView(mPresentation.mSubtitlesSurfaceView);
    }
    vlcVout.addCallback(this);
    vlcVout.attachViews();

    mPlaybackStarted = true;

    if (AndroidUtil.isHoneycombOrLater()) {
        if (mOnLayoutChangeListener == null) {
            mOnLayoutChangeListener = new View.OnLayoutChangeListener() {
                private final Runnable mRunnable = new Runnable() {
                    @Override
                    public void run() {
                        changeSurfaceLayout();
                    }
                };
                @Override
                public void onLayoutChange(View v, int left, int top, int right,
                                           int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
                    if (left != oldLeft || top != oldTop || right != oldRight || bottom != oldBottom) {
                        /* changeSurfaceLayout need to be called after the layout changed */
                        mHandler.removeCallbacks(mRunnable);
                        mHandler.post(mRunnable);
                    }
                }
            };
        }
        mSurfaceFrame.addOnLayoutChangeListener(mOnLayoutChangeListener);
    }
    changeSurfaceLayout();

    if (mMediaRouter != null) {
        // Listen for changes to media routes.
        mediaRouterAddCallback(true);
    }

    loadMedia();

    mSurfaceView.setKeepScreenOn(true);

    // Add any selected subtitle file from the file picker
    if(mSubtitleSelectedFiles.size() > 0) {
        for(String file : mSubtitleSelectedFiles) {
            Log.i(TAG, "Adding user-selected subtitle " + file);
            mService.addSubtitleTrack(file);
        }
    }

    // Set user playback speed
    mService.setRate(mSettings.getFloat(PreferencesActivity.VIDEO_SPEED, 1));
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:67,代码来源:VideoPlayerActivity.java


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