class Panel::Video::FrontEnd::ChannelVideosController < OrbitWidgetController
 def initialize
    super
    @app_title = 'video'
  end

  def channel_videos
    @item = Page.find(params[:page_id]) rescue nil
    if @item
      if @item.frontend_data_count
        @page_num = @item.frontend_data_count
      else
        @page_num = 15
      end
      @frontend_style = @item.frontend_style
    end
    @item = Page.find(params[:page_id]) rescue nil
    if !params[:category_id].blank? || !params[:tag_id].blank?
     @channel_video = ChannelVideo.find(@part.widget_options['channel_videos']) rescue nil
     client = YouTubeIt::Client.new(:dev_key => "AI39si5KGPg8rhKLBfmeukit2tCSP_B9lT8igiNICbrbgUXQoAdYGvsyCGCmO1wGnr1OW4bDRv-ESolwk-rdBNIAgVTL9VYaEA")
     @client_videos = client.videos_by(:user => @channel_video.channel_name, :per_page => 5)   
    end
  end
end