Commit 7c73ea74 authored by Nick Poulden's avatar Nick Poulden
Browse files

Add flash video object and pause when video tab is deactivated

parent 1b1f455e
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -13,9 +13,14 @@ Ext.define('Docs.view.videos.Container', {
     */
    load: function(video) {
        this.tpl = this.tpl || new Ext.XTemplate(
            '<iframe id="videoplayer"',
            ' src="http://player.vimeo.com/video/{id}?portrait=0&amp;color=4CC208"',
            ' width="640" height="360" frameborder="0"></iframe>',
            '<object width="640" height="360" id="video_player">',
                '<param name="allowfullscreen" value="true" />',
                '<param name="allowscriptaccess" value="always" />',
                '<param name="flashvars" value="api=1" />',
                '<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id={id}&amp;server=vimeo.com&amp;color=4CC208&amp;fullscreen=1" />',
                '<embed src="http://vimeo.com/moogaloop.swf?clip_id={id}&amp;server=vimeo.com&amp;color=4CC208&amp;fullscreen=1" ',
                    'type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="640" height="360"></embed>',
            '</object>',
            '<h1>{title}</h1>',
            '<p>{[this.linkify(values.description)]}</p>',
            {
@@ -25,6 +30,16 @@ Ext.define('Docs.view.videos.Container', {
                }
            }
        );

        this.update(this.tpl.apply(video));
    },

    listeners: {
        hide: function() {
            var videoPlayer = document.getElementById('video_player');
            if (videoPlayer && videoPlayer.api_pause) {
                videoPlayer.api_pause();
            }
        }
    }
});
 No newline at end of file