SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-03-2008, 07:55 AM
michaeldjcox michaeldjcox is offline
Sage Fanatic
 
Join Date: Nov 2006
Location: Ipswich, Suffolk, United Kingdom
Posts: 829
Playing a media file

I'm trying to learn how to drive studio to get what I need out of Sage.

Is it possible to have a menu item that will tell sage to play a specific media file e.g an mp3 file?
Reply With Quote
  #2  
Old 12-03-2008, 08:13 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Do you mean you want to play a specific file on the hard drive instead of selecting something that's in the database & displayed in a list? Look into the Watch() or WatchLocalFile() calls, depending on the file's location, and send the file path for that specific file.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #3  
Old 12-03-2008, 09:17 AM
michaeldjcox michaeldjcox is offline
Sage Fanatic
 
Join Date: Nov 2006
Location: Ipswich, Suffolk, United Kingdom
Posts: 829
Thanks - works great
Reply With Quote
  #4  
Old 12-13-2008, 01:32 PM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
Quote:
Originally Posted by Opus4 View Post
Do you mean you want to play a specific file on the hard drive instead of selecting something that's in the database & displayed in a list? Look into the Watch() or WatchLocalFile() calls, depending on the file's location, and send the file path for that specific file.
Is there a way to do this with multiple files? That is, add multiple music files that are not in the database to the Now Playing playlist? I tried using AddToPlaylist() in a loop with multiple java.io.File's but this doesn't seem to work.
__________________
-Craig
Reply With Quote
  #5  
Old 12-13-2008, 09:57 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
The documentation for AddToPlaylist() lists the valid item types (Airing, Album, MediaFile, or Playlist). A playlist cannot contain a java.io.File.

If you want to play multiple files that aren't in the database, you'll need to do handle the queuing yourself and use a FilePlaybackFinished hook to kick off the next one in sequence.
__________________
-- Greg
Reply With Quote
  #6  
Old 12-13-2008, 10:39 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
You could try to use GetMediaFileForFilePath(java.io.File), which returns a MediaFile object for a java.io.File object. I'm not sure what SageTV does if the File passed is NOT in the database, but I suspect that it wouldn't care, and that it would create the MediaFile object anyways. You can then pass that MediaFile object into your playlist.

Of course, given that I'm not a Studio developer, don't put to much faith in my approach
Reply With Quote
  #7  
Old 12-13-2008, 11:36 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Per the docs, GetMediaFileForFilePath() returns null if the file is not in the database, and experimentation with Studio's Expression Evaluator bears this out.
__________________
-- Greg
Reply With Quote
  #8  
Old 12-14-2008, 07:39 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Thanks Greg.... Like I said, don't put too much faith in my approach

Greg, given that Sage supports playing online content, but the MediaPlayerAPI watch API does not play urls, does this mean that Sage always downloads and plays from the filesytem, instead of playing the URL directly? Does Sage have a Watch(url) api call?

It's actually too bad that the PlaylistAPI doesn't support adding content based on a URL, there are number of cases where this would be handy.
Reply With Quote
  #9  
Old 12-14-2008, 09:23 AM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
Thanks, Greg. I'm not sure how I missed the AddToPlaylist() requirements in the docs.

It would be nice if the API supported a playlist of files not in the database since it seems like this would be painful to try to handle with Studio code.
__________________
-Craig
Reply With Quote
  #10  
Old 12-14-2008, 12:28 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
I'm not intimately familiar with the details of how Sage handles online content, but I believe it does download everything to local storage and play it from there.

You could take a look at my SageWMP CD player STVI for an example of managing a queue of non-DB content in Studio code.
__________________
-- Greg
Reply With Quote
  #11  
Old 12-14-2008, 01:15 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
The STV downloads online media to a temporary local file, then that file is played & is deleted when playback is over.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #12  
Old 12-16-2008, 01:57 AM
michaeldjcox michaeldjcox is offline
Sage Fanatic
 
Join Date: Nov 2006
Location: Ipswich, Suffolk, United Kingdom
Posts: 829
I'm trying to play a file that is still being created.

I notice that when a use "Play Other File" in SageMC a small duration is noted.

But happily the player keeps playing the file.

I decided to reuse this action in my application but find that play stops exactly after the duration of the file that was present when play started.

Anybody got any ideas what I need to add to make the media player stop only when theres is actually no more data?
Reply With Quote
  #13  
Old 12-16-2008, 08:38 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Are you playing a local file or what? i.e.: what call are you using to play the file? Is that the same call as used in the code you copied from?

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #14  
Old 12-16-2008, 08:57 AM
michaeldjcox michaeldjcox is offline
Sage Fanatic
 
Join Date: Nov 2006
Location: Ipswich, Suffolk, United Kingdom
Posts: 829
Hi,

My testing is done on a isolated laptop.

Originally I was using Watch() and specifying the path of a local file and found it stopped after the duration available at the time the play started.

Then I noticed if I did "Play Other File" in SageMC (pop up menu in the My Videos area) that it ignored the duration and just kept playing - the desired behaviour.

I tried referencing that action directly in studio and did not get that behaviour :-(

Ultimately I believe the sageMC stuff I'm reusing calls Watch().

I say believe because I'm finding it hard establish a full picture of whats going on with "Play Other File" in SageMC_169.xml (because of my inexperience).

So I feel there is probably some setting I'm missing.

Michael
Reply With Quote
  #15  
Old 12-16-2008, 12:10 PM
michaeldjcox michaeldjcox is offline
Sage Fanatic
 
Join Date: Nov 2006
Location: Ipswich, Suffolk, United Kingdom
Posts: 829
Question

I must be going mad.

I cannot get "Play other file" to repeat that behaviour now.

Bottom line. Here is the question:

Is it possible to be downloading a mp3 file on the server host and play it at concurrently (after some delay e.g. 10 secs ) on an extender in such a way that it only stops playing when all content has been downloaded?


or is this the holy grail of sage customisers?

Many thanks in advance,

Michael
Reply With Quote
  #16  
Old 12-17-2008, 12:03 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
You would have to use SageTV's file download API and perhaps add it as a media file before playing it to get updated info as the file downloads, or else SaegTV doesn't have a way to tell that the file is not complete. This is done for online media playback in the default STV.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #17  
Old 12-17-2008, 04:12 PM
michaeldjcox michaeldjcox is offline
Sage Fanatic
 
Join Date: Nov 2006
Location: Ipswich, Suffolk, United Kingdom
Posts: 829
Thanks. I'll have a play with that
Reply With Quote
  #18  
Old 12-19-2008, 10:05 AM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
I am getting some strange behavior with Watch() and WatchLocalFile(). If I pass in a path (including file name) to a music file it somehow plays multiple files. I have my music in Artist/Album directories and it seems to not only play all the files in the album but also files in other directories?? These files are currently in the Sage database (if it makes a difference) but it still seems like I should be able to just play an individual file with these methods?
__________________
-Craig
Reply With Quote
  #19  
Old 12-19-2008, 12:16 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Check videoframe/autoplay_next_music_file in your .properties file. Sounds like you might have it set to true. (I don't think there's a UI toggle for this property in the stock STV.)
__________________
-- Greg
Reply With Quote
  #20  
Old 12-19-2008, 07:22 PM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
Thanks, Greg. That appears to have been it. Although I'm not sure where that property came from on my client pc since it is nowhere to be found on my server?
__________________
-Craig
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SageTV V6.3 is now available for Win/Linux! Narflex Announcements 1 03-07-2008 12:33 PM
SageTV V6.3.10 Release Candidate Narflex SageTV Beta Test Software 0 02-28-2008 06:07 PM
another way (non dvd profiler) to view offline media? zeltak SageTV Customizations 4 08-20-2006 02:12 PM


All times are GMT -6. The time now is 01:58 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.