1919//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020//SOFTWARE.
2121
22-
23- // require('./modules/vendor/runtime'); // required at runtime for supporting ES7
24-
2522import utils from './modules/utils.es6' ;
2623import Emoji from './modules/emoticons/emoji.es6' ;
2724import Smiley from './modules/emoticons/smiley.es6' ;
@@ -31,6 +28,7 @@ import Video from './modules/video/video.es6';
3128import Twitter from './modules/twitter/twitter.es6' ;
3229import Audio from './modules/audio/audio.es6' ;
3330import Image from './modules/image/image.es6' ;
31+ import BasicVideo from './modules/video/basic.es6' ;
3432
3533import helper from './modules/video/helper.es6' ;
3634
@@ -45,6 +43,8 @@ import helper from './modules/video/helper.es6';
4543 emoji : true ,
4644 fontIcons : true ,
4745 highlightCode : true ,
46+ videoJS : false ,
47+ videojsOptions : { } ,
4848 tweetsEmbed : true ,
4949 tweetOptions : {
5050 maxWidth : 550 ,
@@ -81,7 +81,8 @@ import helper from './modules/video/helper.es6';
8181 beforeEmbedJSApply : function ( ) { } ,
8282 afterEmbedJSApply : function ( ) { } ,
8383 onVideoShow : function ( ) { } ,
84- onTweetsLoad : function ( ) { }
84+ onTweetsLoad : function ( ) { } ,
85+ videojsCallback : function ( ) { }
8586 } ;
8687
8788 class EmbedJS {
@@ -122,13 +123,17 @@ import helper from './modules/video/helper.es6';
122123 render ( result ) {
123124 this . options . element . innerHTML = result ;
124125
125- //Load twitter data with styling
126- twttr . widgets . load ( this . options . element ) ;
126+ if ( twttr ) {
127+ //Load twitter data with styling
128+ twttr . widgets . load ( this . options . element ) ;
129+
130+ //Execute the function after the widget is loaded
131+ twttr . events . bind ( 'loaded' , ( ) => {
132+ this . options . onTweetsLoad ( ) ;
133+ } ) ;
134+ }
127135
128- //Execute the function after the widget is loaded
129- twttr . events . bind ( 'loaded' , ( ) => {
130- this . options . onTweetsLoad ( ) ;
131- } )
136+ BasicVideo . postProcess ( this . options ) ;
132137
133138 helper . play ( 'ejs-video-thumb' , this . options ) ;
134139 this . options . afterEmbedJSApply ( ) ;
0 commit comments