|
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. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
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? |
#2
|
||||
|
||||
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. |
#3
|
|||
|
|||
Thanks - works great
|
#4
|
|||
|
|||
Quote:
__________________
-Craig |
#5
|
||||
|
||||
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 |
#6
|
||||
|
||||
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
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#7
|
||||
|
||||
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 |
#8
|
||||
|
||||
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.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#9
|
|||
|
|||
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 |
#10
|
||||
|
||||
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 |
#11
|
||||
|
||||
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. |
#12
|
|||
|
|||
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? |
#13
|
||||
|
||||
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. |
#14
|
|||
|
|||
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 |
#15
|
|||
|
|||
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 |
#16
|
||||
|
||||
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. |
#17
|
|||
|
|||
Thanks. I'll have a play with that
|
#18
|
|||
|
|||
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 |
#19
|
||||
|
||||
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 |
#20
|
|||
|
|||
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 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
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 |