Jbackend and Template Ionic Material		
	
	
	
		
	
	
	
	
	
		
		
				
		- 
			alphaa
		
 
							- 
													Topic Author
											
 
		
					- 
				
	Offline
			
 
		
					- 
				Junior Member			
 
		
					- 
				
			 
		
			
	
		Less
		More
		
			
									- 
						Posts: 36					
 
				
				
									- 
						Thank you received: 0					
 
				
				
				
				
									- 
											
 
				
				
				
									- 
											
 
				
				
							
		 
	 
		 
		
			
	
						9 years 4 months ago				#5119
		by alphaa
	
	
		
			
			
				How to manipulate the field in the controller  with a regular expression.
I have been trying this :
.filter('unsafe', function($sce) {
var re = /https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube(?:-nocookie)?\.com\S*[^\w\s-])([\w-]{11})(?=[^\w-]|$)(?![?=&+%\w.-]*(?:['"][^<>]*>|<\/a>))[?=&+%\w.-]*/ig;
	
    return function(text) {
		
		 if(text.match(re)) {
            text = text.replace(re,
          '<iframe height="100%" width="100%" src="http://www.youtube.com/embed/$1" allowfullscreen></iframe>');
        }  return $sce.trustAsHtml(text);
    };
but nothing.
:/			
 
					 
	 
			Please Log in  or Create an account to join the conversation.
	
		
			 		
													 
	 
	
		
				
	
		Less
		More
		
			
									- 
						Posts: 3194					
 
				
				
									- 
						Thank you received: 441					
 
				
				
				
				
									- 
											
 
				
				
				
									- 
											
 
				
				
							
		 
	 
		 
		
			
	
						9 years 4 months ago				#5120
		by admin
	
	
		
			
			
				The approach is good, probably you just need to work on the "re" expression.			
					 
	 
			Please Log in  or Create an account to join the conversation.
	
		
			 		
													 
	 
	
		
				
		- 
			alphaa
		
 
							- 
													Topic Author
											
 
		
					- 
				
	Offline
			
 
		
					- 
				Junior Member			
 
		
					- 
				
			 
		
			
	
		Less
		More
		
			
									- 
						Posts: 36					
 
				
				
									- 
						Thank you received: 0					
 
				
				
				
				
									- 
											
 
				
				
				
									- 
											
 
				
				
							
		 
	 
		 
		
			
	
						9 years 3 months ago				#5126
		by alphaa
	
	
		
			
			
				I still can not find a solution. I think my app can not read external url.
I have test this :
var fram = /<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/i;
  return function(text) {
		
		 if(text.match(fram)) {
            text = text.replace(fram, ' ');
        }
and the iframe has not displayed, which means that the problem does not come from here.
Or not ?!			
 
					 
	 
			Please Log in  or Create an account to join the conversation.
	
		
			 		
													 
	 
	
		
				
	
		Less
		More
		
			
									- 
						Posts: 3194					
 
				
				
									- 
						Thank you received: 441					
 
				
				
				
				
									- 
											
 
				
				
				
									- 
											
 
				
				
							
		 
	 
		 
		
			
	
						9 years 3 months ago				#5128
		by admin
	
	
		
			
			
				Sorry, but cannot say just looking at that code without a testbed...			
					 
	 
	
		The following user(s) said Thank You: alphaa 	
			Please Log in  or Create an account to join the conversation.
	
		
			 		
													 
	 
	
		
				
		- 
			alphaa
		
 
							- 
													Topic Author
											
 
		
					- 
				
	Offline
			
 
		
					- 
				Junior Member			
 
		
					- 
				
			 
		
			
	
		Less
		More
		
			
									- 
						Posts: 36					
 
				
				
									- 
						Thank you received: 0					
 
				
				
				
				
									- 
											
 
				
				
				
									- 
											
 
				
				
							
		 
	 
		 
		
			
	
						9 years 3 months ago				#5141
		by alphaa
	
	
		
			
			
				Thanks, i have solved the issue. i have change :
src=\"https://www.youtube.com/embed/...
.			
 
					 
	 
			Please Log in  or Create an account to join the conversation.
	
		
			 		
													 
	 
	
		
				
	
		Less
		More
		
			
									- 
						Posts: 3194					
 
				
				
									- 
						Thank you received: 441					
 
				
				
				
				
									- 
											
 
				
				
				
									- 
											
 
				
				
							
		 
	 
		 
		
	 
 
	
		
	
	
	
	
	
	
 
	
		Time to create page: 0.151 seconds