add autoplay detection for .ts movies
authorAndreas Frisch <andreas.frisch@multimedia-labs.de>
Thu, 14 Aug 2008 07:35:31 +0000 (07:35 +0000)
committerAndreas Frisch <andreas.frisch@multimedia-labs.de>
Thu, 14 Aug 2008 07:35:31 +0000 (07:35 +0000)
lib/python/Components/Scanner.py
lib/python/Plugins/Extensions/MediaPlayer/plugin.py

index 6bd0e3b..69237bc 100644 (file)
@@ -26,8 +26,10 @@ def getType(file):
                        return "application/ogg"
                elif ext == "dmpkg":
                        return "application/x-dream-package"
                        return "application/ogg"
                elif ext == "dmpkg":
                        return "application/x-dream-package"
+               elif ext == "ts":
+                       return "video/MP2T"
                elif ext == "iso":
                elif ext == "iso":
-                       return "video/x-dvd-iso"        
+                       return "video/x-dvd-iso"
                elif file[-12:].lower() == "video_ts.ifo":
                        return "video/x-dvd"
        return type
                elif file[-12:].lower() == "video_ts.ifo":
                        return "video/x-dvd"
        return type
index cb20dd2..e1e0e22 100644 (file)
@@ -784,7 +784,11 @@ def filescan_open(list, session, **kwargs):
 
        mp.switchToPlayList()
        for file in list:
 
        mp.switchToPlayList()
        for file in list:
-               ref = eServiceReference(4097, 0, file.path)
+               if file.mimetype == "video/MP2T":
+                       stype = 1
+               else:
+                       stype = 4097
+               ref = eServiceReference(stype, 0, file.path)
                mp.playlist.addFile(ref)
 
        # TODO: rather play first than last file?
                mp.playlist.addFile(ref)
 
        # TODO: rather play first than last file?
@@ -812,7 +816,7 @@ def audioCD_open(list, session, **kwargs):
 def filescan(**kwargs):
        from Components.Scanner import Scanner, ScanPath
        mediatypes = [
 def filescan(**kwargs):
        from Components.Scanner import Scanner, ScanPath
        mediatypes = [
-               Scanner(mimetypes = ["video/mpeg"],
+               Scanner(mimetypes = ["video/mpeg", "video/MP2T"],
                        paths_to_scan =
                                [
                                        ScanPath(path = "", with_subdirs = False),
                        paths_to_scan =
                                [
                                        ScanPath(path = "", with_subdirs = False),