Commit 64e0df49 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MediaPlayer: Bind stopAsync for 4.0

parent 59676a24
......@@ -14,5 +14,9 @@ int main(int ac, char** av)
auto mp = VLC::MediaPlayer(media);
mp.play();
std::this_thread::sleep_for( std::chrono::seconds( 10 ) );
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
mp.stopAsync();
#else
mp.stop();
#endif
}
......@@ -78,8 +78,13 @@ int main(int ac, char**av)
std::this_thread::sleep_for( std::chrono::seconds( 10 ) );
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
mp.stopAsync();
mp2.stopAsync();
#else
mp.stop();
mp2.stop();
#endif
delete dummyOpaque;
fclose(opaque2->file);
......
......@@ -139,7 +139,11 @@ int main(int ac, char** av)
// expect a single call since both media player share the same event manager
expected = false;
});
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
mp.stopAsync();
#else
mp.stop();
#endif
// Unregister the RegisteredEvent from the other MP's event manager.
// It will be unregistered from both, and when the object gets destroyed
// by leaving the scope, it won't be unregistered from mp2's eventManager.
......
......@@ -161,6 +161,15 @@ public:
getInternalPtr<libvlc_media_t>( md ) ) == 0;
}
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
/**
* Stop playing media list
*/
void stopAsync()
{
libvlc_media_list_player_stop_async(*this);
}
#else
/**
* Stop playing media list
*/
......@@ -168,6 +177,7 @@ public:
{
libvlc_media_list_player_stop(*this);
}
#endif
/**
* Play next item from media list
......
......@@ -192,6 +192,15 @@ public:
libvlc_media_player_pause(*this);
}
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
/**
* @brief stop Stop the playback (no effect if there is no media)
*/
void stopAsync()
{
libvlc_media_player_stop_async(*this);
}
#else
/**
* @brief stop Stop the playback (no effect if there is no media)
*
......@@ -203,6 +212,7 @@ public:
{
libvlc_media_player_stop(*this);
}
#endif
/**
* Set the NSView handler where the media player should render its video
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment