Giter Club home page Giter Club logo

ti.youtube's Introduction

"Titanium" "Alloy" MIT Licence

ti.youtube

Titanium Alloy Widget - YouTube

Simply drop in this Widget and instantly access all the methods within the 'YoutTube IFrame Player API' inside your Android and iOS Applications.

Then add your own ListView, TableView, or any other Component and access any of the Methods (listed below).

iPhone Android

Requirement

  • Titanium SDK

Usage

  • Download the latest release of the widget.
  • Unzip the folder to your project under app/widgets/ti.appraise
  • Add the widget as a dependency to your app/config.json
  • Add the Widget to your .xml (View)
<Widget src="ti.youtube" id="tiYouTube" defaultVideoId="wgg5Tch0-Hs" />

NOTE: The Widget sample code (above) includes a value for the property 'defaultVideoId'. This allows you to define the deafult video to load. You can also include the Widget without this property and a Pre-Loader will be added for you automatically, like this:

<Widget src="ti.youtube" id="tiYouTube" />

Methods

NOTE: This utilizes the built-in YouTube Player Object API.

cueVideoById

Loads the specified video's thumbnail and prepares the player to play the video
{Object}

videoId       (*required*)  
startSeconds  (optional)  
endSeconds    (optional)  

loadVideoById

Loads and plays the specified video
{Object}

videoId       (*required*)  
startSeconds  (optional)  
endSeconds    (optional)  

playVideo

Plays the video (already loaded)

Examples

cueVideoById

$.tiYouTube.cueVideoById({videoId: "F7KHyH2TuhE"});

loadVideoById

$.tiYouTube.loadVideoById({videoId: "F7KHyH2TuhE"});

playVideo

$.tiYouTube.playVideo();

config.json

"dependencies": {
        "ti.youtube": "1.0"
    }

More Information: YouTube API Documentation

Author

License

MIT

ti.youtube's People

Contributors

adamtarmstrong avatar

Watchers

James Cloos avatar Swanand Marathe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.