add autoplay detection for .ts movies
[enigma2.git] / lib / python / Plugins / Extensions / MediaPlayer / plugin.py
index 22fe7c5d6a731f39b0c28ee45c5b9e06955c59a3..e1e0e2269e57f6683594cebda4cbc0611f918b66 100644 (file)
@@ -165,7 +165,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB
                self.coverArtFileName = ""
                self.isAudioCD = False
                self.AudioCD_albuminfo = {}
-               
+
                self.playlistIOInternal = PlaylistIOInternal()
                list = self.playlistIOInternal.open(resolveFilename(SCOPE_CONFIG, "playlist.e2pls"))
                if list:
@@ -784,7 +784,11 @@ def filescan_open(list, session, **kwargs):
 
        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?
@@ -812,7 +816,7 @@ def audioCD_open(list, session, **kwargs):
 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),