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


Java VideoPlayerActivity类代码示例

本文整理汇总了Java中org.videolan.vlc.gui.video.VideoPlayerActivity的典型用法代码示例。如果您正苦于以下问题:Java VideoPlayerActivity类的具体用法?Java VideoPlayerActivity怎么用?Java VideoPlayerActivity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


VideoPlayerActivity类属于org.videolan.vlc.gui.video包,在下文中一共展示了VideoPlayerActivity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: openMediaFile

import org.videolan.vlc.gui.video.VideoPlayerActivity; //导入依赖的package包/类
private void openMediaFile(int p) {
    AudioServiceController audioController = AudioServiceController.getInstance();
    String mediaFile = mDirectoryAdapter.getMediaLocation(p);

    try {
        if (LibVLC.getExistingInstance() == null
                || !LibVLC.getExistingInstance().hasVideoTrack(mediaFile)) {
            List<String> mediaLocations = mDirectoryAdapter.getAllMediaLocations();
            audioController.load(mediaLocations, mediaLocations.indexOf(mediaFile));
        } else {
            VideoPlayerActivity.start(getActivity(), mediaFile);
        }
    } catch (IOException e) {
        /* disk error maybe? */
    }
}
 
开发者ID:smyhvae,项目名称:VlcTest,代码行数:17,代码来源:DirectoryViewFragment.java

示例2: handleVout

import org.videolan.vlc.gui.video.VideoPlayerActivity; //导入依赖的package包/类
private void handleVout() {
    if (!hasCurrentMedia())
        return;
    Log.i(TAG, "Obtained video track");
    String title = getCurrentMedia().getTitle();
    String MRL = mLibVLC.getMediaList().getMRL(mCurrentIndex);
    int index = mCurrentIndex;
    mCurrentIndex = -1;
    mEventHandler.removeHandler(mVlcEventHandler);
    // Preserve playback when switching to video
    hideNotification(false);

    // Don't crash if user stopped the media
    if(!mLibVLC.isPlaying()) return;

    // Switch to the video player & don't lose the currently playing stream
    VideoPlayerActivity.start(VLCApplication.getAppContext(), MRL, title, index, true);
}
 
开发者ID:KlepikovMD,项目名称:popcorntime-android-kitkat,代码行数:19,代码来源:AudioService.java

示例3: playVideo

import org.videolan.vlc.gui.video.VideoPlayerActivity; //导入依赖的package包/类
public String playVideo() {
	if (!"".equals(videoPath)) {
		Intent i = new Intent(this, VideoPlayerActivity.class);
		i.setAction(Intent.ACTION_VIEW);
		i.setData(Uri.parse("file://" + videoPath));

		if (!"".equals(subtitlePath)) {
			i.putExtra(VideoPlayerActivity.SUBTITLE_EXTARA_KEY, subtitlePath);
			i.putExtra(VideoPlayerActivity.SUBTITLE_ENCODING_EXTARA_KEY, subtitleEncoding);
		}
		
		if (!"".equals(fileName)) {
			i.putExtra(VideoPlayerActivity.FILENAME_EXTARA_KEY, fileName);
		}
		
		startActivity(i);
	}
	return videoPath;
}
 
开发者ID:KlepikovMD,项目名称:popcorntime-android-kitkat,代码行数:20,代码来源:HostActivity.java

示例4: openMedia

import org.videolan.vlc.gui.video.VideoPlayerActivity; //导入依赖的package包/类
public static void openMedia(final Context context, final MediaWrapper media){
    if (media == null)
        return;
    if (media.getType() == MediaWrapper.TYPE_VIDEO)
        VideoPlayerActivity.start(context, media.getUri(), media.getTitle());
    else if (media.getType() == MediaWrapper.TYPE_AUDIO) {
        new DialogCallback(context, new DialogCallback.Runnable() {
            @Override
            public void run(PlaybackService service) {
                service.load(media);
            }
        });
    }
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:15,代码来源:Util.java

示例5: getHelper

import org.videolan.vlc.gui.video.VideoPlayerActivity; //导入依赖的package包/类
private static PlaybackServiceActivity.Helper getHelper(Activity activity) {
    if (activity == null)
        return null;

    if ((activity instanceof AudioPlayerContainerActivity))
        return ((AudioPlayerContainerActivity) activity).getHelper();
    else if ((activity instanceof PlaybackServiceActivity))
        return ((PlaybackServiceActivity) activity).getHelper();
    else if ((activity instanceof VideoPlayerActivity))
        return ((VideoPlayerActivity) activity).getHelper();
    else
        return null;
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:14,代码来源:PlaybackServiceFragment.java

示例6: onClick

import org.videolan.vlc.gui.video.VideoPlayerActivity; //导入依赖的package包/类
@Override
public void onClick(View v) {
    switch (v.getId()){
        case R.id.sleep_icon:
            if (VLCApplication.sPlayerSleepTime == null)
                showTimePickerFragment(ACTION_SLEEP_TIMER);
            else {
                setSleep(null);
                mHandler.sendEmptyMessage(TOGGLE_CANCEL);
            }
            break;
        case R.id.playback_speed_icon:
            showPlayBackSpeedDialog();
            break;
        case R.id.jump_chapter_title:
            showSelectChapterDialog();
            break;
        case R.id.audio_delay:
            showAudioSpuDelayControls(ACTION_AUDIO_DELAY);
            break;
        case R.id.spu_delay:
            showAudioSpuDelayControls(ACTION_SPU_DELAY);
            break;
        case R.id.jump_title:
            showTimePickerFragment(ACTION_JUMP_TO_TIME);
            break;
        case R.id.play_as_audio_icon:
            ((VideoPlayerActivity)getActivity()).switchToAudioMode(true);
            break;
        case R.id.opt_equalizer:
            Intent i = new Intent(getActivity(), SecondaryActivity.class);
            i.putExtra("fragment", SecondaryActivity.EQUALIZER);
            startActivity(i);
            dismiss();
            break;
    }
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:38,代码来源:AdvOptionsDialog.java

示例7: switchToVideo

import org.videolan.vlc.gui.video.VideoPlayerActivity; //导入依赖的package包/类
@MainThread
public boolean switchToVideo() {
    if (!canSwitchToVideo())
        return false;
    if (!mMediaPlayer.getVLCVout().areViewsAttached())
        VideoPlayerActivity.startOpened(VLCApplication.getAppContext(), mCurrentIndex);
    return true;
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:9,代码来源:PlaybackService.java

示例8: buildPendingIntent

import org.videolan.vlc.gui.video.VideoPlayerActivity; //导入依赖的package包/类
private PendingIntent buildPendingIntent(MediaWrapper mediaWrapper, int id) {
    Intent intent = new Intent(mContext, VideoPlayerActivity.class);
    intent.setAction(VideoPlayerActivity.PLAY_FROM_VIDEOGRID);
    intent.putExtra(VideoPlayerActivity.PLAY_EXTRA_ITEM_LOCATION, mediaWrapper.getUri());
    intent.putExtra(VideoPlayerActivity.PLAY_EXTRA_ITEM_TITLE, mediaWrapper.getTitle());
    intent.putExtra(VideoPlayerActivity.PLAY_EXTRA_FROM_START, false);

    PendingIntent pi = PendingIntent.getActivity(this, id, intent, PendingIntent.FLAG_UPDATE_CURRENT);
    return pi;
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:11,代码来源:RecommendationsService.java

示例9: onClick

import org.videolan.vlc.gui.video.VideoPlayerActivity; //导入依赖的package包/类
@Override
public void onClick(View v) {
    switch (v.getId()){
        case R.id.sleep:
            if (VLCApplication.sPlayerSleepTime == null)
                showTimePickerFragment(ACTION_SLEEP_TIMER);
            else {
                setSleep(null);
                initSleep();
            }
            break;
        case R.id.playback_speed:
            showPlayBackSpeedDialog();
            break;
        case R.id.jump_chapter_title:
            showSelectChapterDialog();
            break;
        case R.id.audio_delay:
            showAudioSpuDelayControls(ACTION_AUDIO_DELAY);
            break;
        case R.id.spu_delay:
            showAudioSpuDelayControls(ACTION_SPU_DELAY);
            break;
        case R.id.jump_title:
            showTimePickerFragment(ACTION_JUMP_TO_TIME);
            break;
        case R.id.play_as_audio_icon:
            ((VideoPlayerActivity)getActivity()).switchToAudioMode(true);
            break;
        case R.id.opt_equalizer:
            Intent i = new Intent(getActivity(), SecondaryActivity.class);
            i.putExtra("fragment", SecondaryActivity.EQUALIZER);
            startActivity(i);
            dismiss();
            break;
    }
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:38,代码来源:AdvOptionsDialog.java

示例10: startStreaming

import org.videolan.vlc.gui.video.VideoPlayerActivity; //导入依赖的package包/类
/**
 * Starts streaming the video with VLC and cleans up the dialog and poller
 */
private void startStreaming() {
	Uri videoLink = XMLRPCDownloadManager.getInstance().getVideoUri();
	if (videoLink != null) {
		Intent intent = new Intent(Intent.ACTION_VIEW,
				XMLRPCDownloadManager.getInstance().getVideoUri(),
				mActivity.getApplicationContext(),
				VideoPlayerActivity.class);
		mActivity.startActivity(intent);
		pDialog.dismiss();
	} else
		pDialog.setMessage("No video file could be found in the torrent");

	mPoller.stop();
}
 
开发者ID:Tribler,项目名称:tribler-android,代码行数:18,代码来源:PlayButtonListener.java

示例11: onContextItemSelected

import org.videolan.vlc.gui.video.VideoPlayerActivity; //导入依赖的package包/类
@Override
public boolean onContextItemSelected(MenuItem item) {
    if(!getUserVisibleHint()) return super.onContextItemSelected(item);

    AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
    if(info == null) // info can be null
        return super.onContextItemSelected(item);

    int id = item.getItemId();
    String mediaLocation = mDirectoryAdapter.getMediaLocation(info.position);
    if (mediaLocation == null)
        return super.onContextItemSelected(item);

    if(id == R.id.directory_view_play) {
        openMediaFile(info.position);
        return true;
    } else if(id == R.id.directory_view_append) {
        AudioServiceController.getInstance().append(mediaLocation);
        return true;
    } else if(id == R.id.directory_view_delete) {
        AlertDialog alertDialog = CommonDialogs.deleteMedia(getActivity(), mediaLocation,
                new VLCRunnable() {
                    @Override
                    public void run(Object o) {
                        refresh();
                    }
                });
        alertDialog.show();
    } else if(id == R.id.directory_view_play_audio) {
        AudioServiceController.getInstance().load(mediaLocation, true);
    } else if(id == R.id.directory_view_play_video) {
        VideoPlayerActivity.start(getActivity(), mediaLocation);
    }
    return super.onContextItemSelected(item);
}
 
开发者ID:smyhvae,项目名称:VlcTest,代码行数:36,代码来源:DirectoryViewFragment.java

示例12: onListItemClick

import org.videolan.vlc.gui.video.VideoPlayerActivity; //导入依赖的package包/类
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
    if (getListAdapter() == mHistoryAdapter) {
        String selection = ((TextView) v.findViewById(android.R.id.text1)).getText().toString();
        mSearchText.setText(selection);
        mSearchText.setSelection(selection.length());
        mSearchText.requestFocus();
    } else if (getListAdapter() == mResultAdapter) {
        // add search text to the database (history)
        MediaDatabase db = MediaDatabase.getInstance();
        db.addSearchhistoryItem(mSearchText.getText().toString());

        // open media in the player
        Media item = (Media) getListView().getItemAtPosition(position);
        if (item != null) {
            if (item.getType() == Media.TYPE_VIDEO) {
                VideoPlayerActivity.start(getActivity(), item.getLocation());
            } else {
                ArrayList<String> arr = new ArrayList<String>();
                for (int i = 0; i < getListAdapter().getCount(); i++) {
                    Media audioItem = (Media) getListAdapter().getItem(i);
                    if (audioItem.getType() == Media.TYPE_AUDIO)
                        arr.add(audioItem.getLocation());
                }
                AudioServiceController.getInstance().load(arr, arr.indexOf(item.getLocation()));
                return;
            }
        }
        super.onListItemClick(l, v, position, id);

    }
}
 
开发者ID:smyhvae,项目名称:VlcTest,代码行数:33,代码来源:SearchFragment.java

示例13: handleVout

import org.videolan.vlc.gui.video.VideoPlayerActivity; //导入依赖的package包/类
private void handleVout() {
    if (!hasCurrentMedia())
        return;
    Log.i(TAG, "Obtained video track");
    String title = getCurrentMedia().getTitle();
    String MRL = mLibVLC.getMediaList().getMRL(mCurrentIndex);
    int index = mCurrentIndex;
    mCurrentIndex = -1;
    mEventHandler.removeHandler(mVlcEventHandler);
    // Preserve playback when switching to video
    hideNotification(false);

    // Switch to the video player & don't lose the currently playing stream
    VideoPlayerActivity.start(VLCApplication.getAppContext(), MRL, title, index, true);
}
 
开发者ID:smyhvae,项目名称:VlcTest,代码行数:16,代码来源:AudioService.java

示例14: onContextItemSelected

import org.videolan.vlc.gui.video.VideoPlayerActivity; //导入依赖的package包/类
@Override
public boolean onContextItemSelected(MenuItem item) {
    if(!getUserVisibleHint()) return super.onContextItemSelected(item);

    AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
    if(info == null) // info can be null
        return super.onContextItemSelected(item);

    int id = item.getItemId();
    String mediaLocation = mDirectoryAdapter.getMediaLocation(info.position);
    if (mediaLocation == null)
        return super.onContextItemSelected(item);

    if(id == R.id.directory_view_play) {
        openMediaFile(info.position);
        return true;
    } else if(id == R.id.directory_view_append) {
        AudioServiceController.getInstance().append(mediaLocation);
        return true;
    } else if(id == R.id.directory_view_delete) {
        AlertDialog alertDialog = CommonDialogs.deleteMedia(getActivity(), mediaLocation,
                new VlcRunnable() {
                    @Override
                    public void run(Object o) {
                        refresh();
                    }
                });
        alertDialog.show();
    } else if(id == R.id.directory_view_play_audio) {
        AudioServiceController.getInstance().load(mediaLocation, true);
    } else if(id == R.id.directory_view_play_video) {
        VideoPlayerActivity.start(getActivity(), mediaLocation);
    }
    return super.onContextItemSelected(item);
}
 
开发者ID:KlepikovMD,项目名称:popcorntime-android-kitkat,代码行数:36,代码来源:DirectoryViewFragment.java

示例15: onListItemClick

import org.videolan.vlc.gui.video.VideoPlayerActivity; //导入依赖的package包/类
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
    if (getListAdapter() == mHistoryAdapter) {
        String selection = ((TextView) v.findViewById(android.R.id.text1)).getText().toString();
        mSearchText.setText(selection);
        mSearchText.setSelection(selection.length());
        mSearchText.requestFocus();
    } else if (getListAdapter() == mResultAdapter) {
        // add search text to the database (history)
        MediaDatabase db = MediaDatabase.getInstance(this);
        db.addSearchhistoryItem(mSearchText.getText().toString());

        // open media in the player
        Media item = (Media) getListAdapter().getItem(position - 1);
        if (item.getType() == Media.TYPE_VIDEO) {
            VideoPlayerActivity.start(this, item.getLocation());
        } else {
            ArrayList<String> arr = new ArrayList<String>();
            for (int i = 0; i < getListAdapter().getCount(); i++) {
                Media audioItem = (Media) getListAdapter().getItem(i);
                if (audioItem.getType() == Media.TYPE_AUDIO)
                    arr.add(audioItem.getLocation());
            }
            AudioServiceController.getInstance().load(arr, arr.indexOf(item.getLocation()));
            finish();
            return;
        }
        super.onListItemClick(l, v, position, id);

    }
}
 
开发者ID:KlepikovMD,项目名称:popcorntime-android-kitkat,代码行数:32,代码来源:SearchActivity.java


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