/Users/andrea/_magisterarbeit/korpus/clean/trainkorpus/32/file8.html NN ----------------------------------------- : Larry NP Bouthillier's NP Streaming VVG Media NP Player NP Detection NN Tutorial NN server NN side NN Java NP code NN Back RB to TO Streaming VVG Media NP Player NP Detection NN Tutorial NN page NN Listing VVG One CD PlayerDataObject NN . SENT java NP Listing NN Two CD RamDataObject NN . SENT java NP Listing NN Three NP QTDataObject NP . SENT java NP Listing NN Four NP AsxDataObject NP . SENT java NP Listing NN One CD PlayerDataObject NN . SENT java NP 001 CD import NN java NP . SENT lang JJ . SENT . SENT 002 CD import NN java NP . SENT util NP . SENT Hashtable JJ . SENT 003 CD import NN QTDataObject NN . SENT 004 CD import NN RamDataObject NN . SENT 005 CD import NN AsxDataObject NN . SENT 006 CD 007 CD public JJ class NN PlayerDataObject NP 008 CD 009 CD private JJ static JJ Hashtable JJ cPlayerTypes NNS . SENT 010 CD public JJ static JJ String NP REAL NP TYPE NN Real NP , , RealClass NP RamDataObject NP . SENT 011 CD public JJ static JJ String NP WMP NP TYPE NN WMP NP , , WMClass NP AsxDataObject NP . SENT 012 CD public JJ static JJ String NP QT NP TYPE NN QT NP , , QTClass NP QTDataObject NP . SENT 013 CD 014 CD static JJ 015 CD cPlayerTypes NNS new JJ Hashtable NP . SENT 016 CD cPlayerTypes NNS . SENT put VVN REAL JJ TYPE NN , , RealClass NP . SENT 017 CD cPlayerTypes NNS . SENT put VV WMP NP TYPE NN , , WMClass NP . SENT 018 CD cPlayerTypes NNS . SENT put VV QT NP TYPE NN , , QTClass NP . SENT 019 CD 020 JJ 021 CD 022 CD This DT method NN returns VVZ the DT correct JJ subclass NN of IN PlayerDataObject NP for IN 023 CD the DT PlayerType NN passed VVN in IN . SENT The DT PlayerType NN to TO ClassNames NP mapping NN is VBZ done VVN in IN 024 CD a DT static JJ Hashtable NN in IN this DT class NN . SENT In IN a DT real JJ implementation NN we'd NN 025 CD get VVP this DT from IN a DT database NN or CC at IN least JJS a DT properties NNS file VVP , , rather RB than IN 026 CD compiling VVG it PP into IN a DT class NN . SENT 027 CD 028 CD public JJ static JJ PlayerDataObject NN getPlayerDataObject NN String NP pPlayerType NN 029 CD PlayerDataObject NN mDataObject NN null NN . SENT 030 CD String NP mDataObjectName JJ String NP cPlayerTypes NNS . SENT get VV pPlayerType NN . SENT 031 CD System NP . SENT out RB . SENT println NP PLAYERDATAOBJECT NP . SENT getPlayerMetadataObject NN read VVD pPlayerType NN and CC is VBZ going VVG to TO try VV to TO make VV a DT mDataObjectName NN . SENT 032 CD try NN 033 CD if IN mDataObjectName NN . SENT null NN 034 CD mDataObject NN PlayerDataObject NP Class NP . SENT forName JJ mDataObjectName NN . SENT newInstance NN . SENT 035 CD 036 CD 037 CD if IN mDataObject NN . SENT null NN 038 CD System NN . SENT out RB . SENT println NP PLAYERDATAOBJECT NP . SENT getPlayerMetadataObject NN read VVD pPlayerType NN and CC created VVD a DT mDataObject NN . SENT getClass JJ . SENT getName NN . SENT 039 CD return NN mDataObject NN . SENT 040 CD 041 CD catch NN ClassNotFoundException NN cnf NN 042 CD System NN . SENT out RB . SENT println NP PLAYERDATAOBJECT NP . SENT read VVN pPlayerType NN and CC could MD not RB load VV PlayerDataObject NP subclass NN . SENT mDataObjectName NN . SENT cnf NN . SENT getMessage NN . SENT cnf NN . SENT printStackTrace NN . SENT 043 CD 044 CD catch NN InstantiationException NP ie NP System NP . SENT out RB . SENT println NNS Could MD not RB Instantiate VV InstantiationException NP PlayerDataObject NP subclass NN . SENT mDataObjectName NN . SENT 045 CD catch NN IllegalAccessException NN iae NNS System NP . SENT out RB . SENT println NNS Could MD not RB Access NP IllegalAccessException NP PlayerDataObject NP subclass NN . SENT mDataObjectName NN . SENT 046 CD System NP . SENT out RB . SENT println NP PLAYERDATAOBJECT NP . SENT getPlayerDataObject NN returning VVG an DT empty JJ class NN . SENT 047 CD return NN new JJ PlayerDataObject NN . SENT 048 CD 049 CD 050 CD protected JJ String NP cClipname NN . SENT 051 CD public JJ void NN setClipname NN String NP s VVZ 052 CD cClipname NN s PP . SENT 053 CD 054 CD public JJ String NP getClipname NN 055 CD return NN cClipname NN . SENT 056 CD 057 JJ 058 CD 059 CD These DT values NNS should MD be VB overridden VVN by IN descendant NN classes NNS 060 CD 061 CD protected VVN String NP PLUGIN NP MIMETYPE NP null NN . SENT 062 CD protected JJ String NP PLAYER NN MIMETYPE NN null NN . SENT 063 CD public JJ String NP getMimetype NN 064 CD if IN cUsePluginMimetype NN true JJ 065 CD return NN PLUGIN NP MIMETYPE NP . SENT 066 CD else RB 067 CD return NN PLAYER NN MIMETYPE NN . SENT 068 CD 069 JJ 070 CD 071 CD protected JJ boolean JJ cUsePluginMimetype NN false JJ . SENT 072 CD public JJ void JJ setUsePluginMimetype NN boolean NN b SYM 073 CD cUsePluginMimetype NN b LS . SENT 074 CD 075 CD public JJ boolean JJ getUsePluginMimetype NN 076 CD return NN cUsePluginMimetype NN . SENT 077 CD 078 CD 079 JJ 080 CD 081 CD Descendant NN classes NNS should MD override VV this DT method NN to TO 082 RB generate VV the DT appropriate JJ player NN metafile NN for IN that DT 083 CD player NN type NN i NP . SENT e SYM . SENT ram NN file NN , , asx NN file NN , , etc FW . SENT 084 CD Returns NNS a DT fully RB qualified VVN metafile NN to TO redirect VV to TO 085 CD the DT requesting VVG browser NN 086 CD 087 CD public JJ String NP play NN 088 CD return NN null NN . SENT 089 CD 090 CD 091 CD Listing NN One CD PlayerDataObject NN . SENT java NP Listing NN Two CD RamDataObject NN . SENT java NP Listing NN Three NP QTDataObject NP . SENT java NP Listing NN Four NP AsxDataObject NP . SENT java NP Listing NN Two CD RamDataObject NN . SENT java NP 001 CD public NN class NN RamDataObject NP extends VVZ PlayerDataObject NP 002 CD 003 CD public JJ RamDataObject NP 004 CD PLAYER NN MIMETYPE NN audio NN x SYM pn NN realaudio NN . SENT 005 CD PLUGIN NP MIMETYPE NN audio NN x SYM pn NN realaudio NN plugin NN . SENT 006 CD 007 CD 008 CD private JJ String NP theServer NN maaz NN . SENT hbs NNS . SENT edu NN . SENT 009 CD private JJ String NP thePath NN real JJ svt NN . SENT 010 CD 011 CD public JJ String NP play NN 012 CD String NP ramString NN . SENT 013 CD ramString NN rtsp NN . SENT theServer NN thePath NN cClipname NN . SENT rm NP . SENT 014 CD return NN ramString NN . SENT 015 CD 016 CD Listing NN One CD PlayerDataObject NN . SENT java NP Listing NN Two CD RamDataObject NN . SENT java NP Listing NN Three NP QTDataObject NP . SENT java NP Listing NN Four NP AsxDataObject NP . SENT java NP Listing NN Three NP QTDataObject NP . SENT java NP 001 CD public JJ class NN QTDataObject NN extends VVZ PlayerDataObject NP 002 CD 003 CD public JJ QTDataObject NP 004 CD PLAYER NN MIMETYPE NN video NN quicktime NN . SENT 005 CD PLUGIN NP MIMETYPE NP video NN quicktime NN . SENT 006 CD 007 CD 008 CD private JJ String NP theProtocol NN rtsp NN . SENT . SENT 009 CD private JJ String NP theServer NN maaz NN . SENT hbs NNS . SENT edu NN . SENT 010 CD private JJ String NP thePath NN . SENT 011 CD 012 CD public JJ String NP play NN 013 CD String NP smiString NN n NN n NN n NN . SENT 014 CD smiString NN . SENT 015 CD smiString NN . SENT 016 CD smiString NN . SENT 017 CD return NN smiString NN . SENT 018 CD 019 CD Listing NN One CD PlayerDataObject NN . SENT java NP Listing NN Two CD RamDataObject NN . SENT java NP Listing NN Three NP QTDataObject NP . SENT java NP Listing NN Four NP AsxDataObject NP . SENT java NP Listing NN Four NP AsxDataObject NP . SENT java NP 001 CD public JJ class NN AsxDataObject NN extends VVZ PlayerDataObject NP 002 CD 003 CD public JJ AsxDataObject NP 004 CD PLAYER NN MIMETYPE NN video NN x SYM ms NN wmp NN . SENT 005 CD PLAYER NN MIMETYPE NN text NN plain NN . SENT 006 CD PLUGIN NP MIMETYPE NN video NN x SYM ms NN wm NN . SENT 007 CD 008 CD 009 CD private JJ String NP theProtocol NN mms NNS . SENT . SENT 010 CD private JJ String NP theServer NN hbs NNS 12 CD 109 CD . SENT hbs NNS . SENT edu NN . SENT 011 CD private JJ String NP thePath NN . SENT 012 CD 013 CD public JJ String NP play NN 014 CD String NP asxString NN n NN . SENT 015 CD asxString NN n NN . SENT 016 CD asxString NN clip NN win VV title NN n NN . SENT 017 CD asxString NN n NN . SENT 018 CD have VHP to TO calculate VV the DT difference NN between IN clip NN start NN and CC clip NN end NN to TO get VV this DT 019 CD s PP n NN . SENT 020 CD asxString NN n NN . SENT 021 CD asxString NN . SENT 022 CD return NN asxString NN . SENT 023 CD 024 CD