Skip to content

jpanqueva/autoViewerframe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

autoViewerIframe Library Javascript

Example Grafic autoViewerIframe

Javascript library that Allow detecting when a url is entered in an entry, and create an iframe with this transformed url, it is extracted and detected with a regular explanation and the url is constructed with a constant

Install

<script src="src/autoViewerIframe.js" type="text/javascript"></script>

Use HTML

<input id="input_example" 
			type="text" onload="$autoViewerYoutube.bind(this);" 
			data-container-id="container_view_id" 
			class="form-control" 
			placeholder="Paste Your link youtube here..." />

<div id="container_view_id"></div>

The "data-container-id" is the container id of iframe

Use JavaScript

$autoViewerYoutube.bind(document.getElementById("input"));

Configurations

options:{
    regexs:[
        {
          condition: /http(?:s?):\/\/(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-\_]*)(&(amp;)?‌[\w\?=]*)?/,
          embed:"https://www.youtube.com/embed/"
        }
]

// edit in file "autoViewerIframe.js"

Authors

https://github.com/jpanqueva
https://github.com/archarry86

License

MIT License.

About

Javascript library for detecting url in input, and put in Iframe

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published