It isn't. It is equivalent to an automatized search of all peoples conversations all the time, just because it's automatized and done local on the phone doesn't make it not a search. Which means it's pretty much unconstitutional.
It's also probably not very useful as when it is people knowingly committing crime with YT access will know about it and will know how to work around it.
And outside of cases of people which know they are doing illegal things and therefore take precautions it's unlikely to make a relevant difference I think.
But individual countries within the EU can and do have constitutions. Here's title 2, chapter 2, article 28[1] of Romania's constitution:
> Secretul scrisorilor, al telegramelor, al altor trimiteri poştale, al convorbirilor telefonice şi al celorlalte mijloace legale de comunicare este inviolabil.
> Secrecy of the letters, telegrams and other postal communications, of telephone conversations, and of any other legal means of communication is inviolable.
A number of Eastern European countries joined the EU without first bringing their domestic legislation into line with the European treaties. Unsurprisingly, some of those countries have dragged their feet about coming into compliance after the fact.
This is one reason I was in favour of Brexit.
That "title 2 chapter 2" seems reasonable enough to me; but it's a problem if an EU Regulation comes into conflict with the constitution of a member state. If a member state's constitution can override EU legislation, then there's no EU to speak of any more. Any state could then sidestep EU Regulation by simply passing a constitutional clause that declares it unconstitutional.
What I'm saying is that EU Regulations override the legislation of member states, which are required to be in compliance with Regulations. If Romania has a constitutional clause that is overridden by a new Regulation, that Regulation isn't unconstitutional; rather, the clause ceases to be law (or Romania leaves the EU).
I'm speaking about the German constitution. Which the EU has to be compatible to due to agreements when the EU was formed as else Germany could legally not have joined the EU.
(At least this applies to the articles with special protection in the German constitution, which is in violation with.)