Results 1 to 10 of 10

Thread: Play video on button click

  1. #1
    Join Date
    May 2009
    Posts
    113

    Default Play video on button click

    Hey Guys

    I only recently started looking into boxee apps and currently i am at a stand still. What i want to know is, is it possible to play an online video (http://, flash://) using the onclick event of a button? If so how would i do this as i cannot figure it out. If it isnt possible how would i do it?

    Thanks

  2. #2

    Default

    Check out the Player class:
    http://developer.boxee.tv/python-api-reference/#Player

    Specifically Player.Play(ListItem item) where you could set the whole thing up with a button onclick.
    Common issues w/ Boxee:
    Beta Important Info | FAQ & Support Requests | Hulu Mature Content | Search

    UnBoxeed app development:
    Comics.com | ESPN360 | Weather

    For more info, follow app development on Twitter!

  3. #3
    Join Date
    May 2009
    Posts
    113

    Default

    Hey

    Thanks for the reply,though being new im still not 100% what i need to type.

    Curently im trying

    <onclick lang="python"><![CDATA[
    mc.GetPlayer().Play(with flash:// link in here)
    ]]></onclick>

    is that completely wrong.

    Im just trying to get a skin file with a button that says "Play" etc and then the media player starts playing the flash file.

    I cant test player.play() currently as im not on ubuntu.

    Thanks

  4. #4
    Join Date
    Jan 2009
    Location
    Los Angeles, CA
    Posts
    111

    Default

    If you don't need to do specific actions before you play the video, just load up a list and set its path to whatever your Boxee-formatted RSS feed is. The default onclick action for the list items is to play them in the player. If you do want to take actions in python before you play, check the forum for my post on the subject of list items to get the code you need to guarantee compatibility.

  5. #5
    Join Date
    May 2009
    Posts
    113

    Default

    Quote Originally Posted by ameno View Post
    If you don't need to do specific actions before you play the video, just load up a list and set its path to whatever your Boxee-formatted RSS feed is. The default onclick action for the list items is to play them in the player. If you do want to take actions in python before you play, check the forum for my post on the subject of list items to get the code you need to guarantee compatibility.
    Hey

    I havent actually used lists yet so im going to need an example.Iv only been using the boxee api for about a week and had no coding experience before hand so i apologies if i seem like a noob. The link is to a flash video btw not an rss feed if that changes anything.

    Thanks

  6. #6
    Join Date
    May 2009
    Posts
    113

    Default

    Bump

    Still need help guys

  7. #7
    Join Date
    Jan 2009
    Location
    Los Angeles, CA
    Posts
    111

    Default

    Start by building the demo app in the documentation. Just remove the onclick python.

  8. #8
    Join Date
    May 2009
    Posts
    113

    Default

    Quote Originally Posted by ameno View Post
    Start by building the demo app in the documentation. Just remove the onclick python.
    Does this apply to flash:// feeds too? as that is what i am trying to make. Ill try what you have said.

    Thanks

  9. #9
    Join Date
    Jul 2008
    Posts
    61

    Default

    hey,
    whatever you use, you always have to supply a listitem to the player. that was made to work this way so boxee will be able to show information on the playing item and send the info along the social network.
    you can use flash:// but what you have to do is
    Code:
                        listitem = mc.ListItem( mc.ListItem.MEDIA_VIDEO_CLIP )
                        listitem.SetLabel( "whatever" )
                        listitem.SetThumbnail( "http://www.somthing.com/somethingelse.png" )
                        listitem.SetPath( "flash://.." )
                        mc.GetPlayer().Play( listitem )
    please let me know if that works or you need anymore help,
    idan

  10. #10
    Join Date
    May 2009
    Posts
    113

    Default

    Hey Idan

    That did turn out to be the correct way to do it. I found out from the other thread you posted in http://forum.boxee.tv/showthread.php?t=8971.

    This is what i have now

    <onclick lang="python"><![CDATA[
    listitem = mc.ListItem()
    listitem.SetPath("flash:" )
    mc.Player().Play(listitem)
    ]]></onclick>

    Is there any advantage of adding the extra code which you have writen?

    listitem = mc.ListItem( mc.ListItem.MEDIA_VIDEO_CLIP )
    listitem.SetLabel( "whatever" )
    listitem.SetThumbnail( "http://www.somthing.com/somethingelse.png" )

    Also is player.play and getplayer.play the same thing?

    Thanks for your help.

Similar Threads

  1. play video on Button click
    By mradul in forum boxee applications
    Replies: 1
    Last Post: March 29th, 2011, 07:11 PM
  2. Replies: 21
    Last Post: January 26th, 2011, 01:33 PM
  3. Play Video From Listing Directly Using Play Button On Remote
    By war59312 in forum feature requests
    Replies: 1
    Last Post: January 23rd, 2011, 07:38 PM
  4. "Click to Play Video" - means I can't play video
    By nimonus in forum bugs? what bugs?
    Replies: 7
    Last Post: January 5th, 2010, 01:33 PM
  5. can't hit the blasted play button for some video streams
    By twotone8 in forum general boxee help
    Replies: 3
    Last Post: November 4th, 2009, 04:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •