319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Mariandi
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | angular-video
2 | =============
3 |
4 | A directive that takes in a vimeo or a youtube url and converts it into an embedded friendly url and the displays it.
5 |
6 | ###Contributing
7 | angular-video is a free and open source library, and we appreciate any help you're willing to give.
8 |
9 | ### What it does
10 | * Converts any url into an embedded friendly url (according to vimeo's and youtube's preference)
11 | * Gets the trusted resource url using angular's trustAsResourceUrl() functionality
12 |
13 | ### Available url formats
14 | * http://www.youtube.com/watch?v=[xyzxyz]
15 | * http://youtu.be/[xyzxyz]
16 | * http://www.youtube.com/embed/[xyzxyz]
17 | * http://vimeo.com/[xyzxyz]
18 |
19 | ### Getting Started
20 | Download the code, and include the anguvideo.js file in your page. Then add the angvideo module to your Angular App file, e.g.
21 | ```html
22 | var app = angular.module('app', ["anguvideo"]);
23 | ```
24 |
25 | ### Usage
26 |
27 | ```html
28 |
29 | ```
30 |
31 | ```html
32 |
33 | ```
34 | ### Description of attributes
35 | | Attribute | Description | Required | Example |
36 | | :------------- |:-------------| :-----:| :-----|
37 | | ngModel | An angular model containing the URL | Yes | $scope.URL |
38 | | width | The desired width of the video | No | 50% or 500px |
39 | | height | The desired height of the video | No | 400 |
40 | | hide-controls | Set to hide YouTube player controls | No | true |
41 | | auto-play | Set to autoplay video on web | No | true |
42 | | show-info | Set false to hide YouTube title | No | false |
43 | | rel | Set false to not show related videos | No | false |
44 | | modest-branding | Set to hide YouTube brand on controls bar | No | true |
45 |
46 | ### License
47 | The anguvideo project is covered by the [MIT License](http://opensource.org/licenses/MIT "MIT License").
48 |
49 | The MIT License (MIT)
50 |
51 | Copyright (c) 2014 Mariandi Stylianou, and contributors to the angular-video project.
52 |
53 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "anguvideo",
3 | "version": "0.0.2",
4 | "main": "js/anguvideo.js",
5 | "dependencies": {
6 | "angular": "~1.2.16"
7 | },
8 | "keywords": [
9 | "video",
10 | "angularjs",
11 | "embedded",
12 | "directive",
13 | "youtube",
14 | "vimeo"
15 | ],
16 | "homepage": "https://github.com/andoulla/angular-video",
17 | "authors": [
18 | "m.a.s"
19 | ],
20 | "description": "A directive that takes in a vimeo or a youtube url and converts it into an embedded friendly url and the displays it.",
21 | "license": "MIT",
22 | "ignore": [
23 | "**/.*",
24 | "node_modules",
25 | "bower_components",
26 | "test",
27 | "tests"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | AngularJs Video Directive
5 |
6 |
7 |
8 |
anguVideo
9 |
10 | This is a directive that takes in a vimeo or a youtube url and converts it into an embedded friendly url and the displays it.
11 |
12 |
13 |
14 | Note: If an embedded friendly url is provided then the directive will simply gets the trusted resource url using angular's trustAsResourceUrl() functionality and then display the video
15 |
16 |
Url formats:
17 |
18 |
http://www.youtube.com/watch?v=[xyzxyz]
19 |
http://youtu.be/[xyzxyz]
20 |
http://www.youtube.com/embed/[xyzxyz]
21 |
http://vimeo.com/[xyzxyz]
22 |
23 |
24 |
Attributes
25 |
26 | width: width="[number]%" or width="[number]" - for px
27 |