SlideShare una empresa de Scribd logo
1 de 18
Descargar para leer sin conexión
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

@2fdevs

http://twofuckingdevelopers.com

V id e o g u la r 
An HTML5 video player for AngularJS

WeLoveJS

26/10/2013
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

@2fdevs

http://twofuckingdevelopers.com

Two Fucking Developers
3
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

r a ú l
jim é n e z 

@elecash

@2fdevs

m a rc o s
g o n z á le z 

@qmarcos

http://twofuckingdevelopers.com
4
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

angularjs

@2fdevs

http://twofuckingdevelopers.com

data binding
dependency injection
routing
templating
modules
filters
maintained by Google
extend HTML and build web components!
5
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

videogular

@2fdevs

http://twofuckingdevelopers.com

bindable properties
themes
plugins and API
native fullscreen support
mobile support
library agnostic (next release)
it should extend HTML5 video capabilities.
6
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

@2fdevs

videogular demo
bit.ly/1cmKI0k

http://twofuckingdevelopers.com
7
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

videogular
how
it
works
videogular
vg-width
vg-height
vg-theme

@2fdevs

http://twofuckingdevelopers.com

<!DOCTYPE html>
<html ng-app=”MyApp”>
<head>
<title>Videogular</title>
</head>
<body>
<div ng-controller=”MyAppController”>
<div videogular vg-width=”data.width” vg-height=”data.height” vg-theme=”theme.url”>
<video class=’videoPlayer’ preload=’metadata’>
<source src=”assets/videos/oceans-clip.mp4” type=”video/mp4”>
<source src=”assets/videos/oceans-clip.webm” type=”video/webm”>
<source src=”assets/videos/oceans-clip.ogv” type=”video/ogg”>
</video>
</div>
</div>

<!-- Dependencies -->
<script type=”text/javascript” src=”...”></script>

<!-- Videogular files -->
<script type=”text/javascript” src=”videogular.js”></script>

<!-- App -->
<script type=”text/javascript” src=“...”></script>

</body>
</html>
8
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

videogular
themes
vg-theme
css-based
two-way binding

@2fdevs

http://twofuckingdevelopers.com

<!DOCTYPE html>

<html ng-app=”MyApp”>

<head>
<link rel=”stylesheet” href=”themes/default/videogular.css”>
</head>

<body>

<!-- more code... -->
<div videogular vg-width=”data.width” vg-height=”data.height”
vg-theme=”theme.url” vg-autoplay=”data.autoPlay”>
<video class=’videoPlayer’ preload=’metadata’>
<source src=”assets/videos/oceans-clip.mp4” type=”video/mp4”>
<source src=”assets/videos/oceans-clip.webm” type=”video/webm”>
<source src=”assets/videos/oceans-clip.ogv” type=”video/ogg”>
</video>
</div>
<!-- more code... -->
</body>
</html>

when vg-theme is updated it removes previous theme and
injects the new one.
9
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

videogular
bindable
properties
$watch
directive
dispatch event

@2fdevs

http://twofuckingdevelopers.com

videogular.directive(”vgTheme”, function(VG_EVENTS) {
return {
restrict: “A”,
link: function (scope, elem, attrs) {
function updateTheme(value) {
//Inject theme and dispatch event
}

// More code...

if (attrs.vgTheme) {
if (attrs.vgTheme.indexOf(”.css”) < 0) {
scope.$watch(attrs.vgTheme, function(value) {
updateTheme(value);
});
}
else {
updateTheme(attrs.vgTheme);
}
}

}
}
}
);

we check if it’s a variable or a value to $watch or update.
10
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

@2fdevs

http://twofuckingdevelopers.com

w h y p lu g in s ? 
HTML5 poster attribute is cool!
11
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

@2fdevs

http://twofuckingdevelopers.com
12
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

videogular
adding
a plugin
directives
bindable properties
core independant

@2fdevs

http://twofuckingdevelopers.com

<div videogular vg-width=”data.width” vg-height=”data.height”
vg-theme=”theme.url” vg-autoplay=”data.autoPlay”>
<div vg-overlayPlay></div>

<video class=’videoPlayer’ preload=’metadata’>
<source src=”assets/videos/oceans-clip.mp4” type=”video/mp4”>
<source src=”assets/videos/oceans-clip.webm” type=”video/webm”>
<source src=”assets/videos/oceans-clip.ogv” type=”video/ogg”>
</video>
</div>

<script src=”js/vg/videogular.js” type=”text/javascript”></script>
<script src=”js/vg/plugins/overlayplay.js” type=”text/javascript”></script>

var videogularApp = angular.module(”videogularApp”, [
“MyAppController”,
“com.2fdevs.videogular”,
“com.2fdevs.videogular.plugins.overlayplay”
]
);

to add a plugin you only need to write it inside your 
videogular tag, add the .js file and import the plugin.
13
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

videogular
components
inside
plugins
directives
bindable properties
plugin dependant

@2fdevs

http://twofuckingdevelopers.com

<div videogular vg-width=”data.width” vg-height=”data.height”
vg-theme=”theme.url” vg-autoplay=”data.autoPlay”>
<div vg-controls vg-autohide=”data.autoHide” style=”height: 50px;”>
<div vg-playpauseButton></div>
<div vg-timeDisplay>{{ currentTime }}</div>
<div vg-scrubBar>
<div vg-scrubbarcurrenttime></div>
</div>
<div vg-timeDisplay>{{ totalTime }}</div>
<div vg-volume>
<div vg-mutebutton></div>
<div vg-volumebar></div>
</div>
<div vg-fullscreenButton></div>
</div>

<video class=’videoPlayer’ preload=’metadata’>
<source src=”assets/videos/oceans-clip.mp4” type=”video/mp4”>
<source src=”assets/videos/oceans-clip.webm” type=”video/webm”>
<source src=”assets/videos/oceans-clip.ogv” type=”video/ogg”>
</video>
</div>

you could write components inside plugins and they will
be encapsulated inside the plugin.
14
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

videogular
plugins
API
event-based
dependency injected
extendable

@2fdevs

http://twofuckingdevelopers.com

overLayPlay.directive(”vgOverlayplay”, function(VG_EVENTS){
....
function onClickOverlayPlay($event) {
scope.$emit(VG_EVENTS.ON_PLAY_PAUSE);
}

function onComplete(target, params) {
//Show plugin
}

elem.bind(”click”, onClickOverlayPlay);

scope.$on(VG_EVENTS.ON_COMPLETE, onComplete);
...
}

Videogular uses an event-based API to create plugins.

with $emit you can dispatch events to make others react
to your actions.

with $on you can react to events launched by other plugins
or by Videogular.
15
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

videogular
API
events
list

@2fdevs

ON_PLAY
ON_PAUSE
ON_PLAY_PAUSE
ON_START_PLAYING
ON_COMPLETE
ON_SET_STATE
ON_SET_VOLUME
ON_TOGGLE_FULLSCREEN
ON_ENTER_FULLSCREEN
ON_EXIT_FULLSCREEN
ON_BUFFERING
ON_UPDATE_TIME
ON_SEEK_TIME
ON_UPDATE_SIZE
ON_UPDATE_THEME
ON_PLAYER_READY
ON_LOAD_POSTER

http://twofuckingdevelopers.com
16
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

@2fdevs

http://twofuckingdevelopers.com

videogular
 fullscreen support... http://caniuse.com/fullscreen

fullscreen
 desktop support for Chrome, Firefox and Safari.
support 
desktop
mobile
unsupported

mobile support for Chrome/Firefox for Android and iOS
fullscreen API.

future support for unsupported browsers like IE and
Android stock browser. http://youtube.com/html5

for now we just can detect if it has fullscreen support with
a custom polyfill

if (!window.fullScreenAPI) {
var fullScreenButton = angular.element(elem[0]);
fullScreenButton.css(”display”, “none”);
}
17
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

@2fdevs

http://twofuckingdevelopers.com

videogular
 Videogular running on mobile devices

mobile
 · remove vg-width and vg-height to enter in
responsive mode!! NEW!
support


mobile detection
fullscreen
controls

· only video object will be in fullscreen.


· hide volume controls, it doesn’t work on mobile.

· util function to detect if we’re in a mobile

if (VG_UTILS.isMobileDevice()) // do stuff...

this.isMobileDevice = function() {
return (typeof window.orientation !== “undefined”);
};
/18

Videogular: an AngularJS video player
TwoFuckingDevelopers

@2fdevs

Fin :-)
Thanks!
Questions?
@2fdevs
www.twofuckingdevelopers.com
git.com
github.com/2fdevs
git.com
coderwall.com/2fdevs

http://twofuckingdevelopers.com

Más contenido relacionado

La actualidad más candente

2014 HTML5 총정리
2014 HTML5 총정리2014 HTML5 총정리
2014 HTML5 총정리Wonsuk Lee
 
Amazing vue.js projects that are open source and free.
Amazing vue.js projects that are open source and free.Amazing vue.js projects that are open source and free.
Amazing vue.js projects that are open source and free.Katy Slemon
 
Developing Android Apps
Developing Android AppsDeveloping Android Apps
Developing Android AppsClaire Lee
 
MiTM Attacks in Android Apps - TDC 2014
MiTM Attacks in Android Apps - TDC 2014MiTM Attacks in Android Apps - TDC 2014
MiTM Attacks in Android Apps - TDC 2014ivanjokerbr
 
2013년 html5 총정리 (Summary of HTML5 Trend in 2013)
2013년 html5 총정리 (Summary of HTML5 Trend in 2013)2013년 html5 총정리 (Summary of HTML5 Trend in 2013)
2013년 html5 총정리 (Summary of HTML5 Trend in 2013)Wonsuk Lee
 
riffing on Knative - Scott Andrews
riffing on Knative - Scott Andrewsriffing on Knative - Scott Andrews
riffing on Knative - Scott AndrewsVMware Tanzu
 
android design pattern
android design patternandroid design pattern
android design patternLucas Xu
 
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...Gavin Pickin
 
Android Jump Start
Android Jump StartAndroid Jump Start
Android Jump StartHaim Michael
 
Bea Web Logic Workshop81 Jump Start Guide
Bea Web Logic Workshop81 Jump Start GuideBea Web Logic Workshop81 Jump Start Guide
Bea Web Logic Workshop81 Jump Start Guideguest4263ad
 
Android design patterns
Android design patternsAndroid design patterns
Android design patternsPlatty Soft
 
Swift iOS Architecture with FLUX in mind. UA Mobile 2016.
Swift iOS Architecture with FLUX in mind. UA Mobile 2016.Swift iOS Architecture with FLUX in mind. UA Mobile 2016.
Swift iOS Architecture with FLUX in mind. UA Mobile 2016.UA Mobile
 
Learn How to Animate your Android App
Learn How to Animate your Android AppLearn How to Animate your Android App
Learn How to Animate your Android AppEdureka!
 
Angular material tutorial
Angular material tutorialAngular material tutorial
Angular material tutorialHarikaReddy115
 
Android the Agile way
Android the Agile wayAndroid the Agile way
Android the Agile wayAshwin Raghav
 
App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲益祥 許
 
製作 Unity Plugin for Android
製作 Unity Plugin for Android製作 Unity Plugin for Android
製作 Unity Plugin for AndroidJohnny Sung
 
HTC Bluetooth Low Energy Heart Rate Monitor Sample Code
HTC Bluetooth Low Energy Heart Rate Monitor Sample CodeHTC Bluetooth Low Energy Heart Rate Monitor Sample Code
HTC Bluetooth Low Energy Heart Rate Monitor Sample CodeLance Nanek
 

La actualidad más candente (20)

2014 HTML5 총정리
2014 HTML5 총정리2014 HTML5 총정리
2014 HTML5 총정리
 
Amazing vue.js projects that are open source and free.
Amazing vue.js projects that are open source and free.Amazing vue.js projects that are open source and free.
Amazing vue.js projects that are open source and free.
 
Developing Android Apps
Developing Android AppsDeveloping Android Apps
Developing Android Apps
 
MiTM Attacks in Android Apps - TDC 2014
MiTM Attacks in Android Apps - TDC 2014MiTM Attacks in Android Apps - TDC 2014
MiTM Attacks in Android Apps - TDC 2014
 
2013년 html5 총정리 (Summary of HTML5 Trend in 2013)
2013년 html5 총정리 (Summary of HTML5 Trend in 2013)2013년 html5 총정리 (Summary of HTML5 Trend in 2013)
2013년 html5 총정리 (Summary of HTML5 Trend in 2013)
 
riffing on Knative - Scott Andrews
riffing on Knative - Scott Andrewsriffing on Knative - Scott Andrews
riffing on Knative - Scott Andrews
 
android design pattern
android design patternandroid design pattern
android design pattern
 
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
 
Android Jump Start
Android Jump StartAndroid Jump Start
Android Jump Start
 
Bea Web Logic Workshop81 Jump Start Guide
Bea Web Logic Workshop81 Jump Start GuideBea Web Logic Workshop81 Jump Start Guide
Bea Web Logic Workshop81 Jump Start Guide
 
M.youtube can not display
M.youtube can not displayM.youtube can not display
M.youtube can not display
 
Android design patterns
Android design patternsAndroid design patterns
Android design patterns
 
Swift iOS Architecture with FLUX in mind. UA Mobile 2016.
Swift iOS Architecture with FLUX in mind. UA Mobile 2016.Swift iOS Architecture with FLUX in mind. UA Mobile 2016.
Swift iOS Architecture with FLUX in mind. UA Mobile 2016.
 
Learn How to Animate your Android App
Learn How to Animate your Android AppLearn How to Animate your Android App
Learn How to Animate your Android App
 
Effective Android UI - English
Effective Android UI - EnglishEffective Android UI - English
Effective Android UI - English
 
Angular material tutorial
Angular material tutorialAngular material tutorial
Angular material tutorial
 
Android the Agile way
Android the Agile wayAndroid the Agile way
Android the Agile way
 
App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲
 
製作 Unity Plugin for Android
製作 Unity Plugin for Android製作 Unity Plugin for Android
製作 Unity Plugin for Android
 
HTC Bluetooth Low Energy Heart Rate Monitor Sample Code
HTC Bluetooth Low Energy Heart Rate Monitor Sample CodeHTC Bluetooth Low Energy Heart Rate Monitor Sample Code
HTC Bluetooth Low Energy Heart Rate Monitor Sample Code
 

Similar a Welovejs AngularJS

Web applications support on AGL
Web applications support on AGLWeb applications support on AGL
Web applications support on AGLIgalia
 
Animation And Testing In AngularJS
Animation And Testing In AngularJSAnimation And Testing In AngularJS
Animation And Testing In AngularJSEdureka!
 
Live Demo : Trending Angular JS Featues
Live Demo : Trending Angular JS FeatuesLive Demo : Trending Angular JS Featues
Live Demo : Trending Angular JS FeatuesEdureka!
 
Predictable Web Apps with Angular and Redux
Predictable Web Apps with Angular and ReduxPredictable Web Apps with Angular and Redux
Predictable Web Apps with Angular and ReduxFITC
 
Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020Matt Raible
 
AngularJS - The Next Big Thing?
AngularJS - The Next Big Thing?AngularJS - The Next Big Thing?
AngularJS - The Next Big Thing?Tom Hombergs
 
AngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue SolutionsAngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue SolutionsRapidValue
 
Typescript 102 angular and type script
Typescript 102   angular and type scriptTypescript 102   angular and type script
Typescript 102 angular and type scriptBob German
 
Add Custom Model and ORM to Node.js
Add Custom Model and ORM to Node.jsAdd Custom Model and ORM to Node.js
Add Custom Model and ORM to Node.jsDev_Events
 
Ionic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application DevelopmentIonic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application DevelopmentJustin James
 
VizEx View HTML5 Workshop
VizEx View HTML5 WorkshopVizEx View HTML5 Workshop
VizEx View HTML5 WorkshopDavid Manock
 
Developer Training for 23 Video
Developer Training for 23 VideoDeveloper Training for 23 Video
Developer Training for 23 VideoSteffen
 
Polymer - El fin a tus problemas con el FrontEnd
Polymer - El fin a tus problemas con el FrontEndPolymer - El fin a tus problemas con el FrontEnd
Polymer - El fin a tus problemas con el FrontEndIsrael Blancas
 
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)Igalia
 
Pluggable web app using Angular (Odessa JS conf)
Pluggable web app using Angular (Odessa JS conf)Pluggable web app using Angular (Odessa JS conf)
Pluggable web app using Angular (Odessa JS conf)Saif Jerbi
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework Yakov Fain
 
Web Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereWeb Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereJohn Riviello
 

Similar a Welovejs AngularJS (20)

Web applications support on AGL
Web applications support on AGLWeb applications support on AGL
Web applications support on AGL
 
Animation And Testing In AngularJS
Animation And Testing In AngularJSAnimation And Testing In AngularJS
Animation And Testing In AngularJS
 
Live Demo : Trending Angular JS Featues
Live Demo : Trending Angular JS FeatuesLive Demo : Trending Angular JS Featues
Live Demo : Trending Angular JS Featues
 
Predictable Web Apps with Angular and Redux
Predictable Web Apps with Angular and ReduxPredictable Web Apps with Angular and Redux
Predictable Web Apps with Angular and Redux
 
Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020
 
AngularJS - The Next Big Thing?
AngularJS - The Next Big Thing?AngularJS - The Next Big Thing?
AngularJS - The Next Big Thing?
 
AngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue SolutionsAngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue Solutions
 
Typescript 102 angular and type script
Typescript 102   angular and type scriptTypescript 102   angular and type script
Typescript 102 angular and type script
 
Web components api + Vuejs
Web components api + VuejsWeb components api + Vuejs
Web components api + Vuejs
 
Add Custom Model and ORM to Node.js
Add Custom Model and ORM to Node.jsAdd Custom Model and ORM to Node.js
Add Custom Model and ORM to Node.js
 
Ionic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application DevelopmentIonic - Revolutionizing Hybrid Mobile Application Development
Ionic - Revolutionizing Hybrid Mobile Application Development
 
VizEx View HTML5 Workshop
VizEx View HTML5 WorkshopVizEx View HTML5 Workshop
VizEx View HTML5 Workshop
 
VizEx View HTML5 Workshop
VizEx View HTML5 WorkshopVizEx View HTML5 Workshop
VizEx View HTML5 Workshop
 
Developer Training for 23 Video
Developer Training for 23 VideoDeveloper Training for 23 Video
Developer Training for 23 Video
 
Polymer - El fin a tus problemas con el FrontEnd
Polymer - El fin a tus problemas con el FrontEndPolymer - El fin a tus problemas con el FrontEnd
Polymer - El fin a tus problemas con el FrontEnd
 
3d web
3d web3d web
3d web
 
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
 
Pluggable web app using Angular (Odessa JS conf)
Pluggable web app using Angular (Odessa JS conf)Pluggable web app using Angular (Odessa JS conf)
Pluggable web app using Angular (Odessa JS conf)
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
 
Web Components: The Future of Web Development is Here
Web Components: The Future of Web Development is HereWeb Components: The Future of Web Development is Here
Web Components: The Future of Web Development is Here
 

Más de Tomas Corral Casas

Más de Tomas Corral Casas (9)

Introduction to TypeScript
Introduction to TypeScriptIntroduction to TypeScript
Introduction to TypeScript
 
Mikado method
Mikado methodMikado method
Mikado method
 
Testea y aumenta tu karma
Testea y aumenta tu karmaTestea y aumenta tu karma
Testea y aumenta tu karma
 
Coderdojo bcn 12_10_2013
Coderdojo bcn 12_10_2013Coderdojo bcn 12_10_2013
Coderdojo bcn 12_10_2013
 
Lo que los desarrolladores web deberían saber
Lo que los desarrolladores web deberían saberLo que los desarrolladores web deberían saber
Lo que los desarrolladores web deberían saber
 
Hydra.js modula tu código
Hydra.js modula tu códigoHydra.js modula tu código
Hydra.js modula tu código
 
Less is more
Less is moreLess is more
Less is more
 
Design patterns in Javascript
Design patterns in JavascriptDesign patterns in Javascript
Design patterns in Javascript
 
Automatización Unit Testing Javascript
Automatización Unit Testing JavascriptAutomatización Unit Testing Javascript
Automatización Unit Testing Javascript
 

Último

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Último (20)

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Welovejs AngularJS

  • 1. /18 Videogular: an AngularJS video player TwoFuckingDevelopers @2fdevs http://twofuckingdevelopers.com V id e o g u la r An HTML5 video player for AngularJS WeLoveJS 26/10/2013
  • 2. /18 Videogular: an AngularJS video player TwoFuckingDevelopers @2fdevs http://twofuckingdevelopers.com Two Fucking Developers
  • 3. 3 /18 Videogular: an AngularJS video player TwoFuckingDevelopers r a ú l jim é n e z @elecash @2fdevs m a rc o s g o n z á le z @qmarcos http://twofuckingdevelopers.com
  • 4. 4 /18 Videogular: an AngularJS video player TwoFuckingDevelopers angularjs @2fdevs http://twofuckingdevelopers.com data binding dependency injection routing templating modules filters maintained by Google extend HTML and build web components!
  • 5. 5 /18 Videogular: an AngularJS video player TwoFuckingDevelopers videogular @2fdevs http://twofuckingdevelopers.com bindable properties themes plugins and API native fullscreen support mobile support library agnostic (next release) it should extend HTML5 video capabilities.
  • 6. 6 /18 Videogular: an AngularJS video player TwoFuckingDevelopers @2fdevs videogular demo bit.ly/1cmKI0k http://twofuckingdevelopers.com
  • 7. 7 /18 Videogular: an AngularJS video player TwoFuckingDevelopers videogular how it works videogular vg-width vg-height vg-theme @2fdevs http://twofuckingdevelopers.com <!DOCTYPE html> <html ng-app=”MyApp”> <head> <title>Videogular</title> </head> <body> <div ng-controller=”MyAppController”> <div videogular vg-width=”data.width” vg-height=”data.height” vg-theme=”theme.url”> <video class=’videoPlayer’ preload=’metadata’> <source src=”assets/videos/oceans-clip.mp4” type=”video/mp4”> <source src=”assets/videos/oceans-clip.webm” type=”video/webm”> <source src=”assets/videos/oceans-clip.ogv” type=”video/ogg”> </video> </div> </div> <!-- Dependencies --> <script type=”text/javascript” src=”...”></script> <!-- Videogular files --> <script type=”text/javascript” src=”videogular.js”></script> <!-- App --> <script type=”text/javascript” src=“...”></script> </body> </html>
  • 8. 8 /18 Videogular: an AngularJS video player TwoFuckingDevelopers videogular themes vg-theme css-based two-way binding @2fdevs http://twofuckingdevelopers.com <!DOCTYPE html> <html ng-app=”MyApp”> <head> <link rel=”stylesheet” href=”themes/default/videogular.css”> </head> <body> <!-- more code... --> <div videogular vg-width=”data.width” vg-height=”data.height” vg-theme=”theme.url” vg-autoplay=”data.autoPlay”> <video class=’videoPlayer’ preload=’metadata’> <source src=”assets/videos/oceans-clip.mp4” type=”video/mp4”> <source src=”assets/videos/oceans-clip.webm” type=”video/webm”> <source src=”assets/videos/oceans-clip.ogv” type=”video/ogg”> </video> </div> <!-- more code... --> </body> </html> when vg-theme is updated it removes previous theme and injects the new one.
  • 9. 9 /18 Videogular: an AngularJS video player TwoFuckingDevelopers videogular bindable properties $watch directive dispatch event @2fdevs http://twofuckingdevelopers.com videogular.directive(”vgTheme”, function(VG_EVENTS) { return { restrict: “A”, link: function (scope, elem, attrs) { function updateTheme(value) { //Inject theme and dispatch event } // More code... if (attrs.vgTheme) { if (attrs.vgTheme.indexOf(”.css”) < 0) { scope.$watch(attrs.vgTheme, function(value) { updateTheme(value); }); } else { updateTheme(attrs.vgTheme); } } } } } ); we check if it’s a variable or a value to $watch or update.
  • 10. 10 /18 Videogular: an AngularJS video player TwoFuckingDevelopers @2fdevs http://twofuckingdevelopers.com w h y p lu g in s ? HTML5 poster attribute is cool!
  • 11. 11 /18 Videogular: an AngularJS video player TwoFuckingDevelopers @2fdevs http://twofuckingdevelopers.com
  • 12. 12 /18 Videogular: an AngularJS video player TwoFuckingDevelopers videogular adding a plugin directives bindable properties core independant @2fdevs http://twofuckingdevelopers.com <div videogular vg-width=”data.width” vg-height=”data.height” vg-theme=”theme.url” vg-autoplay=”data.autoPlay”> <div vg-overlayPlay></div> <video class=’videoPlayer’ preload=’metadata’> <source src=”assets/videos/oceans-clip.mp4” type=”video/mp4”> <source src=”assets/videos/oceans-clip.webm” type=”video/webm”> <source src=”assets/videos/oceans-clip.ogv” type=”video/ogg”> </video> </div> <script src=”js/vg/videogular.js” type=”text/javascript”></script> <script src=”js/vg/plugins/overlayplay.js” type=”text/javascript”></script> var videogularApp = angular.module(”videogularApp”, [ “MyAppController”, “com.2fdevs.videogular”, “com.2fdevs.videogular.plugins.overlayplay” ] ); to add a plugin you only need to write it inside your videogular tag, add the .js file and import the plugin.
  • 13. 13 /18 Videogular: an AngularJS video player TwoFuckingDevelopers videogular components inside plugins directives bindable properties plugin dependant @2fdevs http://twofuckingdevelopers.com <div videogular vg-width=”data.width” vg-height=”data.height” vg-theme=”theme.url” vg-autoplay=”data.autoPlay”> <div vg-controls vg-autohide=”data.autoHide” style=”height: 50px;”> <div vg-playpauseButton></div> <div vg-timeDisplay>{{ currentTime }}</div> <div vg-scrubBar> <div vg-scrubbarcurrenttime></div> </div> <div vg-timeDisplay>{{ totalTime }}</div> <div vg-volume> <div vg-mutebutton></div> <div vg-volumebar></div> </div> <div vg-fullscreenButton></div> </div> <video class=’videoPlayer’ preload=’metadata’> <source src=”assets/videos/oceans-clip.mp4” type=”video/mp4”> <source src=”assets/videos/oceans-clip.webm” type=”video/webm”> <source src=”assets/videos/oceans-clip.ogv” type=”video/ogg”> </video> </div> you could write components inside plugins and they will be encapsulated inside the plugin.
  • 14. 14 /18 Videogular: an AngularJS video player TwoFuckingDevelopers videogular plugins API event-based dependency injected extendable @2fdevs http://twofuckingdevelopers.com overLayPlay.directive(”vgOverlayplay”, function(VG_EVENTS){ .... function onClickOverlayPlay($event) { scope.$emit(VG_EVENTS.ON_PLAY_PAUSE); } function onComplete(target, params) { //Show plugin } elem.bind(”click”, onClickOverlayPlay); scope.$on(VG_EVENTS.ON_COMPLETE, onComplete); ... } Videogular uses an event-based API to create plugins. with $emit you can dispatch events to make others react to your actions. with $on you can react to events launched by other plugins or by Videogular.
  • 15. 15 /18 Videogular: an AngularJS video player TwoFuckingDevelopers videogular API events list @2fdevs ON_PLAY ON_PAUSE ON_PLAY_PAUSE ON_START_PLAYING ON_COMPLETE ON_SET_STATE ON_SET_VOLUME ON_TOGGLE_FULLSCREEN ON_ENTER_FULLSCREEN ON_EXIT_FULLSCREEN ON_BUFFERING ON_UPDATE_TIME ON_SEEK_TIME ON_UPDATE_SIZE ON_UPDATE_THEME ON_PLAYER_READY ON_LOAD_POSTER http://twofuckingdevelopers.com
  • 16. 16 /18 Videogular: an AngularJS video player TwoFuckingDevelopers @2fdevs http://twofuckingdevelopers.com videogular fullscreen support... http://caniuse.com/fullscreen fullscreen desktop support for Chrome, Firefox and Safari. support desktop mobile unsupported mobile support for Chrome/Firefox for Android and iOS fullscreen API. future support for unsupported browsers like IE and Android stock browser. http://youtube.com/html5 for now we just can detect if it has fullscreen support with a custom polyfill if (!window.fullScreenAPI) { var fullScreenButton = angular.element(elem[0]); fullScreenButton.css(”display”, “none”); }
  • 17. 17 /18 Videogular: an AngularJS video player TwoFuckingDevelopers @2fdevs http://twofuckingdevelopers.com videogular Videogular running on mobile devices mobile · remove vg-width and vg-height to enter in responsive mode!! NEW! support mobile detection fullscreen controls · only video object will be in fullscreen. · hide volume controls, it doesn’t work on mobile. · util function to detect if we’re in a mobile if (VG_UTILS.isMobileDevice()) // do stuff... this.isMobileDevice = function() { return (typeof window.orientation !== “undefined”); };
  • 18. /18 Videogular: an AngularJS video player TwoFuckingDevelopers @2fdevs Fin :-) Thanks! Questions? @2fdevs www.twofuckingdevelopers.com git.com github.com/2fdevs git.com coderwall.com/2fdevs http://twofuckingdevelopers.com