Could not play youtube video
Posted: 02 Apr 2023 12:22
Hello,
Currently, I am developing video player for android using Qt. I could play a media over internet server(https://OOO.avi) with no problem. However I could not play youtube video. VLC for Android version 3.5.4(2023-02-20) could play youtube.(The version 3.5.3 could not). So I used the libvlc extracted from that .apk file. But I could not play youtube.
I created media by
libvlc_media_t* p_md = libvlc_media_new_location( libvlc_instance, "https://www.youtube.com/watch?v=Jd2gBcwOWkE");
And I tried to get the subItem of p_md using
But I always got sub_items_count = 0.
Do I have to something else.
Thank you for reading my question.
Currently, I am developing video player for android using Qt. I could play a media over internet server(https://OOO.avi) with no problem. However I could not play youtube video. VLC for Android version 3.5.4(2023-02-20) could play youtube.(The version 3.5.3 could not). So I used the libvlc extracted from that .apk file. But I could not play youtube.
I created media by
libvlc_media_t* p_md = libvlc_media_new_location( libvlc_instance, "https://www.youtube.com/watch?v=Jd2gBcwOWkE");
And I tried to get the subItem of p_md using
Code: Select all
libvlc_media_t *PlayerBase::get_sub_media(libvlc_media_t *p_md)
{
if( !p_md )
return nullptr;
libvlc_media_parse(p_md);
libvlc_media_list_t* sub_items = libvlc_media_subitems( p_md );
libvlc_media_t* sub_item = nullptr;
int sub_items_count = -1;
if( sub_items ){
libvlc_media_list_lock( sub_items );
sub_items_count = libvlc_media_list_count( sub_items );
for( int i = 0; i < sub_items_count; ++i ) {
sub_item = libvlc_media_list_item_at_index( sub_items, i );
if (sub_item)
break;
}
libvlc_media_list_unlock( sub_items );
libvlc_media_list_release( sub_items );
}
return sub_item;
}
Do I have to something else.
Thank you for reading my question.