mirror of
https://github.com/ecency/ecency-mobile.git
synced 2025-01-03 19:42:03 +03:00
added support to play inline youtube video content in app builtin player
This commit is contained in:
parent
216a6b3738
commit
71b3a33623
@ -19,10 +19,24 @@ export const parseLinkData = (tnode:TNode):LinkData => {
|
||||
}
|
||||
|
||||
if(tnode.classes.includes('markdown-external-link')){
|
||||
|
||||
//inline external links can contain video links, for such tags and video id or url is contained as
|
||||
//attribute if that is the case, use in app video modal to play content
|
||||
//for now, only youtube id is supported
|
||||
const youtubeId = tnode.attributes['data-youtube']
|
||||
if(youtubeId){
|
||||
return {
|
||||
type:'markdown-external-link',
|
||||
href: tnode.attributes['data-href']
|
||||
type:'markdown-video-link-youtube',
|
||||
youtubeId:youtubeId.length > 11 && youtubeId[12] === '?' ? youtubeId.substring(0,11):youtubeId //this is a workaround to avoid feeding query parameters to youtube player
|
||||
}
|
||||
}
|
||||
//TOOD: support other video link later
|
||||
|
||||
//use default markdown-external-link with url;
|
||||
return {
|
||||
type:'markdown-external-link',
|
||||
href: tnode.attributes['data-href']
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user