Hello,
I’m putting together a playlist sharing script and I’m having difficulty adding new arrays for Youtube’s new url variations with playlists. For example…
[code]https://www.youtube.com/watch?v=h82o28mZ1c0&list=PLFECE7FC63DE15EA3 <<<<<THIS WORKS!
http://www.youtube.com/playlist?list=PLFECE7FC63DE15EA3 <<<<<Displays link text
http://youtu.be/h82o28mZ1c0?list=PLFECE7FC63DE15EA3 <<<<<Displays single video
http://www.youtube.com/embed/h82o28mZ1c0?list=PLFECE7FC63DE15EA3 <<<<<Displays the link text[/code]
Here’s the code. How do I add new arrays for the other youtube url variations?
[code]$types = array(
‘youtube’=>array(
array(
‘https{0,1}://w{0,3}.youtube.com/watch?\Sv=([A-Za-z0-9_-]+)&list=([A-Za-z0-9_-]+)[^< ]*’,
‘’
),
array(
‘https{0,1}://w{0,3}.youtu.be/([A-Za-z0-9_-]+)[^< ]’,
‘’
)
),
'soundcloud'=>array(
array(
'https{0,1}:\/\/w{0,3}\.*soundcloud\.com\/([-\%_\/.a-zA-Z0-9]+\/[-\%_\/.a-zA-Z0-9]+)[^< ]*',
'<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https://soundcloud.com/$1&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true"></iframe>'
)
),
);[/code]