mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 04:04:18 +00:00 
			
		
		
		
	Added support for YouTube videos
This commit is contained in:
		@@ -168,6 +168,10 @@ class _PostTileState extends State<PostTile> {
 | 
				
			|||||||
        postContent = _buildPostImage();
 | 
					        postContent = _buildPostImage();
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      case PostKind.YOUTUBE:
 | 
				
			||||||
 | 
					        postContent = _buildPostYouTube();
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      case PostKind.WEB_LINK:
 | 
					      case PostKind.WEB_LINK:
 | 
				
			||||||
        postContent = _buildPostWebLink();
 | 
					        postContent = _buildPostWebLink();
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
@@ -259,6 +263,22 @@ class _PostTileState extends State<PostTile> {
 | 
				
			|||||||
    );
 | 
					    );
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Widget _buildPostYouTube() {
 | 
				
			||||||
 | 
					    return RaisedButton(
 | 
				
			||||||
 | 
					      color: Colors.red,
 | 
				
			||||||
 | 
					      textColor: Colors.white,
 | 
				
			||||||
 | 
					      child: Row(
 | 
				
			||||||
 | 
					        mainAxisSize: MainAxisSize.min,
 | 
				
			||||||
 | 
					        children: <Widget>[
 | 
				
			||||||
 | 
					          Icon(Icons.ondemand_video),
 | 
				
			||||||
 | 
					          Text(tr("YouTube movie"))
 | 
				
			||||||
 | 
					        ],
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					      onPressed: () =>
 | 
				
			||||||
 | 
					          launch("https://youtube.com/watch/?v=" + widget.post.filePath),
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Widget _buildPostWebLink() {
 | 
					  Widget _buildPostWebLink() {
 | 
				
			||||||
    return Card(
 | 
					    return Card(
 | 
				
			||||||
      color: Color.fromRGBO(0xf7, 0xf7, 0xf7, 1),
 | 
					      color: Color.fromRGBO(0xf7, 0xf7, 0xf7, 1),
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user