/** * @brief Toggle media playback * * If it is currently playing, pause playback. If it is currently paused, * start playback. * * @sa gtk_vlc_player_play * @sa gtk_vlc_player_pause * * @param player \e GtkVlcPlayer instance * @return \c TRUE if media is playing \b after the operation, * \c FALSE if it is paused. */ gboolean gtk_vlc_player_toggle(GtkVlcPlayer *player) { if (libvlc_media_player_is_playing(player->priv->media_player)) gtk_vlc_player_pause(player); else gtk_vlc_player_play(player); return (gboolean)libvlc_media_player_is_playing(player->priv->media_player); }
void player::play() { if (!mp) { //if player is not load with media dataObject ob; ob.object = "player"; ob.msg = "media_explorer_media"; Notify(ob); return; } if (libvlc_media_player_is_playing(mp)) { //if current playing /* Pause */ // libvlc_media_player_pause(mp); dataObject ob; ob.object = "player"; ob.msg = "play"; // Notify(ob); } else { //if not playing /* Play again */ dataObject ob; ob.object = "player"; ob.msg = "pause"; // Notify(ob); libvlc_media_player_play(mp); } }
bool player::isPLay() { if (mp == NULL) { // if player is nnit initialise return false return false; } else { // if player is initialise return the whether is somethings playing return libvlc_media_player_is_playing(mp); } }
void VLCMainwindow::openFile() { /* Just the basic file-select box */ QString fileOpen = QFileDialog::getOpenFileName(this,tr("Load a file"), "~"); fileOpen.replace("/", "\\"); /* Stop if something is playing */ if( vlcPlayer && libvlc_media_player_is_playing(vlcPlayer) ) stop(); /* New Media */ libvlc_media_t *vlcMedia = libvlc_media_new_path(vlcObject,qtu(fileOpen)); if( !vlcMedia ) return; vlcPlayer = libvlc_media_player_new_from_media (vlcMedia); libvlc_media_release(vlcMedia); /* Integrate the video in the interface */ #if defined(Q_OS_MAC) libvlc_media_player_set_nsobject(vlcPlayer, videoWidget->winId()); #elif defined(Q_OS_UNIX) libvlc_media_player_set_xwindow(vlcPlayer, videoWidget->winId()); #elif defined(Q_OS_WIN) libvlc_media_player_set_hwnd(vlcPlayer, videoWidget->winId()); #endif //int windid = videoWidget->winId(); //libvlc_media_player_set_xwindow (vlcPlayer, windid ); /* And play */ libvlc_media_player_play (vlcPlayer); //Set vars and text correctly playBut->setText("Pause"); }
void Mwindow::openFile() { /* The basic file-select box */ QString fileOpen = QFileDialog::getOpenFileName(this, tr("Load a file"), "~"); /* Stop if something is playing */ if (vlcPlayer && libvlc_media_player_is_playing(vlcPlayer)) stop(); /* Create a new Media */ libvlc_media_t *vlcMedia = libvlc_media_new_path(vlcInstance, qtu(fileOpen)); if (!vlcMedia) return; /* Create a new libvlc player */ vlcPlayer = libvlc_media_player_new_from_media (vlcMedia); /* Release the media */ libvlc_media_release(vlcMedia); /* Integrate the video in the interface */ #if defined(Q_OS_MAC) libvlc_media_player_set_nsobject(vlcPlayer, (void *)videoWidget->winId()); #elif defined(Q_OS_UNIX) libvlc_media_player_set_xwindow(vlcPlayer, videoWidget->winId()); #elif defined(Q_OS_WIN) libvlc_media_player_set_hwnd(vlcPlayer, videoWidget->winId()); #endif /* And start playback */ libvlc_media_player_play (vlcPlayer); /* Update playback button */ playBut->setText("Pause"); }
void VlcVideoWidget::Play() { if (!vlcPlayer_) return; if (!libvlc_media_player_is_playing(vlcPlayer_)) libvlc_media_player_play(vlcPlayer_); }
gboolean xmr_player_playing(XmrPlayer *player) { g_return_val_if_fail(player != NULL, FALSE); return libvlc_media_player_is_playing(player->priv->player) == 1; }
void VlcWidget::disableScreenSaver () { auto e = Util::MakeEntity ("ScreensaverProhibition", {}, {}, "x-leechcraft/power-management"); e.Additional_ ["ContextID"] = "org.vtyulc.VlcTab"; e.Additional_ ["Enable"] = libvlc_media_player_is_playing (VlcPlayer_->GetPlayer ().get ()); Proxy_->GetEntityManager ()->HandleEntity (e); }
jboolean Java_org_videolan_libvlc_LibVLC_isPlaying(JNIEnv *env, jobject thiz) { libvlc_media_player_t *mp = getMediaPlayer(env, thiz); if (mp) return !!libvlc_media_player_is_playing(mp); else return 0; }
void MainWindow::OnPlayPause(wxCommandEvent& event) { if(libvlc_media_player_is_playing(media_player) == 1) { pause(); } else { play(); } }
bool CAVPlayer::IsPlaying() { if (m_pVLC_Player) { return (1 == libvlc_media_player_is_playing(m_pVLC_Player)); } return false; }
int VLCWrapperImpl::isPlaying() { int nRet = 0; if ( m_pMediaPlayer ) { nRet = libvlc_media_player_is_playing(m_pMediaPlayer, &m_VLCex); ProcessVLCException(&m_VLCex, m_EH); } return nRet; }
jboolean Java_org_videolan_libvlc_MediaPlayer_isPlaying(JNIEnv *env, jobject thiz) { vlcjni_object *p_obj = VLCJniObject_getInstance(env, thiz); if (!p_obj) return false; return !!libvlc_media_player_is_playing(p_obj->u.p_mp); }
void VlcVideoPlayer::playPause() { if (firstPlay_) { libvlc_media_player_play(vlcPlayer); firstPlay_ = !firstPlay_; } libvlc_media_player_set_pause(vlcPlayer, libvlc_media_player_is_playing(vlcPlayer)); }
void NPlaybackEngineVlc::play() { if (!hasMedia()) return; if (!libvlc_media_player_is_playing(m_mediaPlayer)) libvlc_media_player_play(m_mediaPlayer); else pause(); }
int qtVlc::isPlaying() { if(mUrl != "") { return libvlc_media_player_is_playing(mp); } else { return false; } }
bool VlcControl::isPlaying() { if(libvlc_media_player_is_playing(vlcPlayer)) { return TRUE; } else { return FALSE; } }
void VLCVideoTextureObjChunk::updateTime(void) { if ((libvlc == NULL) || (vlcmediaplayer == NULL)) return; if (libvlc_media_player_is_playing(vlcmediaplayer)!=1) return; // only update if > MIN_TIME_DIFF ms offset long test=labs(libvlc_media_player_get_time(vlcmediaplayer)-this->getTimestamp()); if (test>MIN_TIME_DIFF) { libvlc_media_player_set_time(vlcmediaplayer, this->getTimestamp()); SLOG << "resyncing video: " << test << std::endl; } }
STDMETHODIMP VLCPlaylist::get_isPlaying(VARIANT_BOOL* isPlaying) { if( NULL == isPlaying ) return E_POINTER; libvlc_media_player_t *p_md; HRESULT hr = getMD(&p_md); if( SUCCEEDED(hr) ) { *isPlaying = varbool( libvlc_media_player_is_playing(p_md) ); } return hr; };
int libvlc_pause(int nameId) { int result = 0; CHECK_NAMEID(nameId); if (libvlc_media_player_is_playing(soundPlay[nameId]) == 0) { result = libvlc_media_player_play(soundPlay[nameId]); } else { libvlc_media_player_pause(soundPlay[nameId]); } return result; }
void VLCVideoTextureObjChunk::resizeVideo() { if ((libvlc == NULL) || (vlcmediaplayer == NULL)) return; libvlc_time_t current_time=0; bool play = true; if (libvlc_media_player_is_playing(vlcmediaplayer)!=1) play=false; current_time = libvlc_media_player_get_time(vlcmediaplayer); SINFO << "restart video at " << current_time << std::endl; createVLCInstance(current_time,play); }
void player::pause() { // libvlc_media_player_set_pause(mp,pause()); // pause(); if (mp && libvlc_media_player_is_playing(mp)) {// if player is initialize pause player libvlc_media_player_pause(mp); dataObject ob; ob.object = "player"; ob.msg = "play"; // Notify(ob); } else { // exit(EXIT_FAILURE); } }
bool VlcVideoWidget::Seek(s64 time) { if (vlcPlayer_) { if (libvlc_media_player_is_playing(vlcPlayer_)) { if (libvlc_media_player_is_seekable(vlcPlayer_)) { libvlc_media_player_set_time(vlcPlayer_, time); return true; } } } return false; }
void VLCMainwindow::play() { if(vlcPlayer) { if (libvlc_media_player_is_playing(vlcPlayer)) { libvlc_media_player_pause(vlcPlayer); playBut->setText("Play"); } else { libvlc_media_player_play(vlcPlayer); playBut->setText("Pause"); } } }
bool VlcVideoWidget::TogglePlay() { statusAccess.lock(); bool stoppedNow = status.stopped; statusAccess.unlock(); if (stoppedNow) { Play(); return true; } else { Pause(); return (libvlc_media_player_is_playing(vlcPlayer_) > 0 ? true : false); } }
void VLCVideoTextureObjChunk::checkForSync(void) { if ((libvlc == NULL) || (vlcmediaplayer == NULL)) return; if (libvlc_media_player_is_playing(vlcmediaplayer)!=1) return; // only the master sets the timestamp if (getIsMaster()==true) { OSG::TimeStamp now = OSG::getTimeStamp(); if (OSG::getTimeStampMsecs(now-lastSync) > getUpdatefreq()) { lastSync=now; setTimestamp(libvlc_media_player_get_time(vlcmediaplayer)+NETWORK_LATENCY); commitChanges(); } } }
void Mwindow::play() { if (!vlcPlayer) return; if (libvlc_media_player_is_playing(vlcPlayer)) { /* Pause */ libvlc_media_player_pause(vlcPlayer); playBut->setText("Play"); } else { /* Play again */ libvlc_media_player_play(vlcPlayer); playBut->setText("Pause"); } }
bool VLCVideoWrapper::isPlaying(void) const { bool error(false); // check if media player is playing int playing = libvlc_media_player_is_playing(_MediaPlayer); // check for errors error = checkVLCError("checking play state"); if(!error) { // returns true if the media is playing return ((playing > 0)?(true):(false)); } else { return false; } }
void PlayerEngine_vlc::get_File(std::string uri){ /* Stop if something is playing */ if (vlcPlayer && libvlc_media_player_is_playing(vlcPlayer)) stopState(); message = "Status : Loading"; /* Create a new Media */ libvlc_media_t *vlcMedia = libvlc_media_new_path(vlcInstance,&uri[0]/*uri.c_str()*/); if (!vlcMedia) { message = "Error : failed to create media"; return; } /* Create a new libvlc player */ vlcPlayer = libvlc_media_player_new_from_media (vlcMedia); //gulong window_id; //libvlc_media_player_set_xwindow(vlcPlayer,window_id); //Player_ControlsGUI win; //win.set_xwindows_id(window_id); /* Release the media */ libvlc_media_release(vlcMedia); /* And start playback */ /* libvlc_media_player_play (vlcPlayer); message = "Status : Playing"; */ // catch the exception from here }
void PlayerEngine_vlc::playState(){ if (!vlcPlayer) return; if (libvlc_media_player_is_playing(vlcPlayer)) { /* Pause */ libvlc_media_player_pause(vlcPlayer); } else { /* Play again */ libvlc_media_player_play(vlcPlayer); } }